Magnus,

One way, for example. is to pass in a component, or even a list of
components, to the ShoppingCartPanel's constructor and your onClick could
then do the necessary. Since your ShoppingCartPanel knows it going to use
AJAX, its constructor may also choose to setOutputMarkupId(true) on the
passed in components.

BTW, is "Beer" a special kind of Norwegian cheese then?

Regards - Cemal
jWeekend
OO & Java Technologies, Wicket Training and Development 
http://jWeekend.com



Magnus Haraldsen Amundsen wrote:
> 
> Hi,
> 
> I'm following the Cheesr examples in the "Wicket in Action" book and have
> met a problem when ajaxifying it.
> 
> I have Index.java that displays a shopping cart from a custom shopping
> cart panel (ShoppingCartPanel.java). This custom panel has a remove link
> for each item, and clicking this removes the item from the list using
> Ajax. In Index.java I also have a Checkout button that is set to visible
> when there's items in the shopping cart. I need to refresh this component
> also using Ajax when I press the remove link in the shopping cart panel,
> so that it is hidden when the cart is empty. How do I update this
> component from my custom shopping cart panel? Do I have to make the
> Checkout button a public variable and refresh it using 
> target.addComponent(Index.checkout) in ShoppingCartPanel.java, or is there
> an easier and more elegant way to do this?
> 
> Index.java - http://pastebin.com/m76c0eb71
> ShoppingCartPanel.java - http://pastebin.com/m70f20055
> 
> Regards,
> 
> Magnus
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Ajax%3A-Updating-component-outside-Panel-tp25776573p25776733.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to