You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "ildella@gmail.com" <il...@gmail.com> on 2010/12/13 17:16:15 UTC

Re: [1.5] [Solved] onBeforeRender() not called after AjaxRequestTarget.add()

Ok, I got it, I told I was rusty :)
I forgot that if a component is marked non visible on the first time is
rendered, it will never be rendered again until someone make it visilble.

Of course, I can't make it visible again in it's own onBeforeRender that is
exactly the method that will never be called again.

On Mon, Dec 13, 2010 at 2:14 PM, ildella@gmail.com <il...@gmail.com>wrote:

> sorry email was started before I completed it.
> Anyway I'll prepare a working zip and wil send the issue as a jira bug if I
> can confirm the problem.
>
> On Mon, Dec 13, 2010 at 2:13 PM, ildella@gmail.com <il...@gmail.com>wrote:
>
>> a couple of new experiments:
>>
>> I've added comp1 and comp2 as target in the onEvent.
>> comp1 just have
>>
>>             @Override
>>             protected void onBeforeRender() {
>>                 super.onBeforeRender();
>>             }
>>
>> while comp2
>>
>>             @Override
>>             protected void onBeforeRender() {
>>
>>                 super.onBeforeRender();
>>
>>             }
>>
>> On Mon, Dec 13, 2010 at 2:02 PM, ildella@gmail.com <il...@gmail.com>wrote:
>>
>>> Hey everyone.
>>>
>>> Maybe I am a little rusty with Wicket but.. I am on  a new project with
>>> Wicket 1.5, M3. I have a simple behavior on a form field:
>>>
>>>          form.add(otherComponent);
>>>         form.add(codeField);
>>>         codeField.add(new AjaxEventBehavior("onChange") {
>>>             @Override
>>>             protected void onEvent(final AjaxRequestTarget target) {
>>>                 target.add(form);
>>>             }
>>>         });
>>>
>>> I expect that the onBeforeRender of all components of the form would be
>>> called when the onChange arrives. Instead tests and debugger tells me that
>>> whie target.add(form) is called, the onBeforeRender method of any of the
>>> form component is while, for example, isVisible is called.
>>>
>>> What am I missing here?
>>> Form has the output markup id set to true, and I remember that all the
>>> form child shoud inherit that settings but this does not appear to be true
>>> anymore.
>>> Anyway, even assigning component.setOutputMarkupId(true) to all form
>>> components, their onBeforeRender is not called
>>>
>>> I can't found any open bug about these problems, so maybe I am wrong
>>> about something.
>>>
>>> --
>>> Daniele Dellafiore
>>> http://danieledellafiore.net
>>>
>>
>>
>>
>> --
>> Daniele Dellafiore
>> http://danieledellafiore.net
>>
>
>
>
> --
> Daniele Dellafiore
> http://danieledellafiore.net
>



-- 
Daniele Dellafiore
http://danieledellafiore.net

Re: [1.5] [Solved] onBeforeRender() not called after AjaxRequestTarget.add()

Posted by "ildella@gmail.com" <il...@gmail.com>.
On Mon, Dec 13, 2010 at 5:18 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> onconfigure


Yes, I also tried to use that new 1.5 method but again, overriding the one
of the component but is a tecnique that does not work. It is needed to set
the visiblity in the onConfigure of a parent object that is alwasy rendered.

Fair enough, I got it now.

-- 
Daniele Dellafiore
http://danieledellafiore.net

Re: [1.5] [Solved] onBeforeRender() not called after AjaxRequestTarget.add()

Posted by Igor Vaynberg <ig...@gmail.com>.
see component#onconfigure()

-igor

On Mon, Dec 13, 2010 at 6:16 PM, ildella@gmail.com <il...@gmail.com> wrote:
> Ok, I got it, I told I was rusty :)
> I forgot that if a component is marked non visible on the first time is
> rendered, it will never be rendered again until someone make it visilble.
>
> Of course, I can't make it visible again in it's own onBeforeRender that is
> exactly the method that will never be called again.
>
> On Mon, Dec 13, 2010 at 2:14 PM, ildella@gmail.com <il...@gmail.com>wrote:
>
>> sorry email was started before I completed it.
>> Anyway I'll prepare a working zip and wil send the issue as a jira bug if I
>> can confirm the problem.
>>
>> On Mon, Dec 13, 2010 at 2:13 PM, ildella@gmail.com <il...@gmail.com>wrote:
>>
>>> a couple of new experiments:
>>>
>>> I've added comp1 and comp2 as target in the onEvent.
>>> comp1 just have
>>>
>>>             @Override
>>>             protected void onBeforeRender() {
>>>                 super.onBeforeRender();
>>>             }
>>>
>>> while comp2
>>>
>>>             @Override
>>>             protected void onBeforeRender() {
>>>
>>>                 super.onBeforeRender();
>>>
>>>             }
>>>
>>> On Mon, Dec 13, 2010 at 2:02 PM, ildella@gmail.com <il...@gmail.com>wrote:
>>>
>>>> Hey everyone.
>>>>
>>>> Maybe I am a little rusty with Wicket but.. I am on  a new project with
>>>> Wicket 1.5, M3. I have a simple behavior on a form field:
>>>>
>>>>          form.add(otherComponent);
>>>>         form.add(codeField);
>>>>         codeField.add(new AjaxEventBehavior("onChange") {
>>>>             @Override
>>>>             protected void onEvent(final AjaxRequestTarget target) {
>>>>                 target.add(form);
>>>>             }
>>>>         });
>>>>
>>>> I expect that the onBeforeRender of all components of the form would be
>>>> called when the onChange arrives. Instead tests and debugger tells me that
>>>> whie target.add(form) is called, the onBeforeRender method of any of the
>>>> form component is while, for example, isVisible is called.
>>>>
>>>> What am I missing here?
>>>> Form has the output markup id set to true, and I remember that all the
>>>> form child shoud inherit that settings but this does not appear to be true
>>>> anymore.
>>>> Anyway, even assigning component.setOutputMarkupId(true) to all form
>>>> components, their onBeforeRender is not called
>>>>
>>>> I can't found any open bug about these problems, so maybe I am wrong
>>>> about something.
>>>>
>>>> --
>>>> Daniele Dellafiore
>>>> http://danieledellafiore.net
>>>>
>>>
>>>
>>>
>>> --
>>> Daniele Dellafiore
>>> http://danieledellafiore.net
>>>
>>
>>
>>
>> --
>> Daniele Dellafiore
>> http://danieledellafiore.net
>>
>
>
>
> --
> Daniele Dellafiore
> http://danieledellafiore.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org