> Has anybody used something like javax.swing.ListModel.addListDataListener or
> java.util.Observable to setup a nice way for components to respond to
> changes in other components?
>
> My use case is that I have a "basket" of items a user has selected. While
> they are searching/browsing if an item already in the basket appears again I
> want it to be disabled/greyed out. With hand coding that is a bit ugly and
> seems like a candidate for some sort listening to changes in another
> component.

This is where Wicket really works different from a desktop framework
like Swing though. In swing you would generally push changes to
observers. In Wicket, you have the request/ response cycle. 'Pulling'
works better for Wicket, which typically means that you should make
sure you update relevant state during requests (e.g. via models) so
that other components use the updated state. So here, you wouldn't
call setEnabled on the basket via some observer, but rather you would
do something like override isEnabled and query the relevant state.

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to