You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Brown, Berlin [GCG-PFS]" <Be...@Primerica.com> on 2011/07/14 17:13:36 UTC

target.addComponent and impact

If you have an ajax event and then you call target.addComponent on
another component or collection of other components.
 
Are there issues with calling target.addComponent on components that
aren't visible or maybe detached from the page?
 
Or calling target.addComponent more than once on a particular component?


Re: target.addComponent and impact

Posted by Martin Grigorov <mg...@apache.org>.
You added the component so it has to be re-rendered.

On Thu, Jul 14, 2011 at 7:18 PM, Brown, Berlin [GCG-PFS]
<Be...@primerica.com> wrote:
> One more question.
>
> Is it is a hint to update this particular component?  Or will wicket
> fully rerender the component the user whether it needs to get updated or
> not?
>
>
> -----Original Message-----
> From: Brown, Berlin [GCG-PFS]
> Sent: Thursday, July 14, 2011 12:06 PM
> To: 'users@wicket.apache.org'
> Subject: RE: target.addComponent and impact
>
> Let's say that I have a component in the hashmap that needs to get
> updated and let's that I call target.addComponent on some parent
> component, in that case will the child get updated twice.
>
> E.g.
>
> Target.addComponent(someChildComponent);
> Target.addComponent(someParentOfTheChild);
>
> In this case, will child get "updated" twice or still just once ...
> Because the parent will take care of having the child updated?
> -----Original Message-----
> From: Andrea Del Bene [mailto:adelbene@ciseonweb.it]
> Sent: Thursday, July 14, 2011 11:55 AM
> To: users@wicket.apache.org
> Subject: Re: target.addComponent and impact
>
> Right, I've looked at code and it uses an hashmap
>> in last case i think rendering will be once because the components are
>
>> kept in map with markupid of component as key in ajaxrequesttarget.
>>
>> On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del
> Bene<ad...@ciseonweb.it>  wrote:
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


RE: target.addComponent and impact

Posted by "Brown, Berlin [GCG-PFS]" <Be...@Primerica.com>.
One more question.

Is it is a hint to update this particular component?  Or will wicket
fully rerender the component the user whether it needs to get updated or
not?
 

-----Original Message-----
From: Brown, Berlin [GCG-PFS] 
Sent: Thursday, July 14, 2011 12:06 PM
To: 'users@wicket.apache.org'
Subject: RE: target.addComponent and impact

Let's say that I have a component in the hashmap that needs to get
updated and let's that I call target.addComponent on some parent
component, in that case will the child get updated twice.

E.g.

Target.addComponent(someChildComponent);
Target.addComponent(someParentOfTheChild);

In this case, will child get "updated" twice or still just once ...
Because the parent will take care of having the child updated?
-----Original Message-----
From: Andrea Del Bene [mailto:adelbene@ciseonweb.it]
Sent: Thursday, July 14, 2011 11:55 AM
To: users@wicket.apache.org
Subject: Re: target.addComponent and impact

Right, I've looked at code and it uses an hashmap
> in last case i think rendering will be once because the components are

> kept in map with markupid of component as key in ajaxrequesttarget.
>
> On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del
Bene<ad...@ciseonweb.it>  wrote:
>


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




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


Re: target.addComponent and impact

Posted by Martin Grigorov <mg...@apache.org>.
just once. the parent will be rendered

On Thu, Jul 14, 2011 at 7:06 PM, Brown, Berlin [GCG-PFS]
<Be...@primerica.com> wrote:
> Let's say that I have a component in the hashmap that needs to get
> updated and let's that I call target.addComponent on some parent
> component, in that case will the child get updated twice.
>
> E.g.
>
> Target.addComponent(someChildComponent);
> Target.addComponent(someParentOfTheChild);
>
> In this case, will child get "updated" twice or still just once ...
> Because the parent will take care of having the child updated?
> -----Original Message-----
> From: Andrea Del Bene [mailto:adelbene@ciseonweb.it]
> Sent: Thursday, July 14, 2011 11:55 AM
> To: users@wicket.apache.org
> Subject: Re: target.addComponent and impact
>
> Right, I've looked at code and it uses an hashmap
>> in last case i think rendering will be once because the components are
>
>> kept in map with markupid of component as key in ajaxrequesttarget.
>>
>> On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del
> Bene<ad...@ciseonweb.it>  wrote:
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


RE: target.addComponent and impact

Posted by "Brown, Berlin [GCG-PFS]" <Be...@Primerica.com>.
Let's say that I have a component in the hashmap that needs to get
updated and let's that I call target.addComponent on some parent
component, in that case will the child get updated twice.

E.g.

Target.addComponent(someChildComponent);
Target.addComponent(someParentOfTheChild);

In this case, will child get "updated" twice or still just once ...
Because the parent will take care of having the child updated?
-----Original Message-----
From: Andrea Del Bene [mailto:adelbene@ciseonweb.it] 
Sent: Thursday, July 14, 2011 11:55 AM
To: users@wicket.apache.org
Subject: Re: target.addComponent and impact

Right, I've looked at code and it uses an hashmap
> in last case i think rendering will be once because the components are

> kept in map with markupid of component as key in ajaxrequesttarget.
>
> On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del
Bene<ad...@ciseonweb.it>  wrote:
>


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




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


Re: target.addComponent and impact

Posted by Andrea Del Bene <ad...@ciseonweb.it>.
Right, I've looked at code and it uses an hashmap
> in last case i think rendering will be once because the components are
> kept in map with markupid of component as key in ajaxrequesttarget.
>
> On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del Bene<ad...@ciseonweb.it>  wrote:
>


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


Re: target.addComponent and impact

Posted by vineet semwal <vi...@gmail.com>.
in last case i think rendering will be once because the components are
kept in map with markupid of component as key in ajaxrequesttarget.

On Thu, Jul 14, 2011 at 9:11 PM, Andrea Del Bene <ad...@ciseonweb.it> wrote:
> Hi,
>>
>> If you have an ajax event and then you call target.addComponent on
>> another component or collection of other components.
>
> What do you mean with "another component"? You should be able to add any
> component you want, except AbstractRepeater subclasses (ListView,
> RepeatingView, ecc...). These components must be inside a different
> container to be updated via Ajax (i.e. you must call addComponent on this
> container).
>>
>> Are there issues with calling target.addComponent on components that
>> aren't visible or maybe detached from the page?
>
> You can call addComponent on invisible component but you must call
> setOutputMarkupPlaceholderTag before adding them (see Component JavaDoc). I
> never tried calling addComponent on a detached component...
>
>>
>> Or calling target.addComponent more than once on a particular component?
>>
> That should lead to a multiple rendering of the component.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
thank you,

regards,
Vineet Semwal

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


Re: target.addComponent and impact

Posted by Andrea Del Bene <ad...@ciseonweb.it>.
Hi,
> If you have an ajax event and then you call target.addComponent on
> another component or collection of other components.
What do you mean with "another component"? You should be able to add any 
component you want, except AbstractRepeater subclasses (ListView, 
RepeatingView, ecc...). These components must be inside a different 
container to be updated via Ajax (i.e. you must call addComponent on 
this container).
>
> Are there issues with calling target.addComponent on components that
> aren't visible or maybe detached from the page?

You can call addComponent on invisible component but you must call 
setOutputMarkupPlaceholderTag before adding them (see Component 
JavaDoc). I never tried calling addComponent on a detached component...

>
> Or calling target.addComponent more than once on a particular component?
>
That should lead to a multiple rendering of the component.


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