I've put some code up at
http://www.wicket-wiki.org.uk/wiki/index.php/DropDownChoice_Examples
which shows the two approaches...

Offhand, are there any cases where Ajax might not be preferable to
onSelectionChange?  If no JavaScript, then neither will work, will
they?

Also, if it worth adding a IndicatingAjaxFormComponentUpdatingBehavior
to extentions?  (The only trick is to add the indicatorAppender in the
getBind() rather than the constructor.)

/Gwyn

On 13/06/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> welp, thats the nature of ajax :) i suppose on ajax update you can attach
> javascript to the target that would remove the select one from the first
> drop down or refresh it entirely.
>
> -Igor
>
>
>
>  On 6/13/06, Gwyn Evans <[EMAIL PROTECTED]> wrote:
> > Hi,
> > Thanks & just for the record...
> >
> > The second was using the first's value, via a CompoundPropertyModel,
> > but that wasn't enough of a linkage to trigger a change.  Updating the
> > choice model on the onSelectionChanged gave me the behaviour I wanted
> > though.
> >
> > Having done that though, it was trivial to add Ajax support & move
> > that to the onUpdate callback instead.
> >
> > There is one minor difference that I noticed in the Ajax/non-Ajax
> > behaviours, which we might want to document if we can work out where
> > to do so,
> > i.e...
> >   When using a dropdown that was initialised to use a nullSelection
> > string (e.g. "Choose One") and onSelectionChanged, when a choice is
> > made the drodown gets reloaded.  As it's no longer got a null
> > selection, the "Choose One" string doesn't appear (which may affect
> > the width of the drop-down if it was previously the longest option
> > string).
> > If AJAX is used instead, the dropdown doesn't itself get reloaded, so
> > the nullSelection string remains (and can still be selected.)
> >
> > /Gwyn
> >
> > On 13/06/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > all you have to do is in the onselectionchanged of the first change the
> > > items that the second's choice model is pointing to, or change the
> choices
> > > model entirely by calling setchoices
> > >
> > > take a look at the ajax example in wicket examples of the two drop
> downs,
> > > take away the ajax behavior and it will work with a simple page refresh.
> > >
> > > -Igor
> > >
> > >
> > >
> > > On 6/12/06, Gwyn Evans <[EMAIL PROTECTED] > wrote:
> > > >
> > >  Hi,
> > >   I've got a form with a couple of dropdowns, where the values in the
> > > 2nd depend on the selection of the first.  If using
> > > wantOnSelectionChangedNotifications() on the first, is
> > > there a way of
> > > triggering a refresh on the second, as part of the
> > > onSelectionChanged() callback of the first or do I need to do a
> > > Form.process() to do that?
> > >
> > > (I could probably Ajax it, but that was planned for once I've got it
> > > working 'traditionally'.)
> > >
> > > /Gwyn


_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to