You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by eugenebalt <eu...@yahoo.com> on 2011/07/31 22:25:50 UTC

Updating a Component from anywhere

I have a Panel containing a Label that shows how many items are in the
shopping cart right now.

The Label should be updated (via Ajax) from within any number of pages,
forms, and panels throughout the application. Various sub- and
sub-panels/forms/etc. may have the "Add To Cart" link that should update
this Label, so the Ajax update can come from various points.

The Panel with this Label is always displayed at the top of every page.

My question is, is there an easy way to save as a "global variable" this
Label component (or, the containing Panel) so it's available to everybody
all the time? Thanks.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-a-Component-from-anywhere-tp3708349p3708349.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Updating a Component from anywhere

Posted by Martijn Dashorst <ma...@gmail.com>.
You're thinking about it the wrong way: you should ask how do I let
this label (or panel) know about an ajax event happening?

Queue wicket 1.5's event mechanism:
https://cwiki.apache.org/WICKET/migration-to-wicket-15.html#MigrationtoWicket1.5-Intercomponentevents

Martijn

On Sun, Jul 31, 2011 at 2:54 PM, eugenebalt <eu...@yahoo.com> wrote:
> Essentially what I'm asking is, is there an easy way to find a component,
> among the entire current tree of all components included or cross-included
> in the final page, from anywhere in the code.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-a-Component-from-anywhere-tp3708349p3708386.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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


Re: Updating a Component from anywhere

Posted by eugenebalt <eu...@yahoo.com>.
Essentially what I'm asking is, is there an easy way to find a component,
among the entire current tree of all components included or cross-included
in the final page, from anywhere in the code.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Updating-a-Component-from-anywhere-tp3708349p3708386.html
Sent from the Users forum mailing list archive at Nabble.com.

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