Martin Makundi wrote:
Now if I change the country, I must change the list of allowed values
for cityCombo.
http://wicketstuff.org/wicket13/ajax/choice
Thanks, I remember seeing that but already forgot about the idea that
a dropdown choice can be a model, and a smart model too.
interface statechangedlistener { protected void
onstatechanged(ajaxrequesttarget t); }
city.onupdate() { getpage().visitchildren(statechangedlistener.class) {...}}
there is your basic listener support.
Ok. Something like this. I do not know if I want to bind it directly
to the page hierarcy though, it might be some other construct just for
that purpose. And I do not know if I want a listener interface if I
can make the models reload themselves -> in that case the construct
should maybe automatically attach onchangelisteners? Maybe, e.g.,
mutable/immutable treenodes...
I've been thinking about writing aspects that fire
Component.onModelChanged even when the model's object changed (possibly
deep within an object hierarchy). Another option would be to use
PropertyChangeSupport. Either way, you'd never require listeners or
other complex notification structures. This would be especially useful
with AJAX, because then all components that get onModelChanged can add
themselves to the AjaxRequestTarget.
By the way, the jira patch Igor mentioned:
https://issues.apache.org/jira/browse/WICKET-1312. I really like it.
Matthijs.
--
Matthijs Wensveen
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]