Maybe it's because your second and third dropdowns are taking their
input from the posted parameters (the raw input) instead of from their
model. See the source for FormComponent.getValue():
if (NO_RAW_INPUT.equals(rawInput))
{
return getModelValue();
}
else
{
if (getEscapeModelStrings() && rawInput != null)
{
return
Strings.escapeMarkup(rawInput).toString();
}
return rawInput;
}
After submit, your dropdowns are probably taking the second branch. So
in your updating behavior, try something like:
protected void onUpdate(AjaxRequestTarget target) {
dropDown2.clearInput(); <--- reset input !!!
dropDown2.setModelObject(null);
target.addComponent(dropDown2);
}
This not only sets the second dropdown model to null but also resets its input.
Regards,
Carlos
On 9/6/07, JulianS <[EMAIL PROTECTED]> wrote:
>
> I am using Wicket 1.2.6. I have 3 DropDownChoices (and some other fields) on
> a form.
>
> The first DropDownChoice resets the selections in the other DropDownChoices
> using AjaxFormComponentUpdatingBehavior("onchange"). All the DropDownChoices
> use PropertyModels.
>
> This all works fine until the form is submitted and validation fails. In
> this (normal) situation the form is still visible, with the feedback
> messages displayed, but the 2nd and 3rd DropDownChoices no longer react to
> the first DropDownChoice. I have verified that the properties on which
> DropDownChoices depend are being correctly set.
>
> Is there anything I can do to make them behave properly? Any help is
> appreciated.
>
> Thanks,
> Julian
>
> --
> View this message in context:
> http://www.nabble.com/Problem-with-DropDownChoice-and-AjaxFormComponentUpdatingBehavior-tf4394596.html#a12531138
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]