Fabio Fioretti wrote:
> 
> This is what I do, basically:
> 1) Select a choice from the ListChoice;
> 2) The form automatically fills with the data of the selected
> recommendation instance;
> 3) Modify the data in the form so that validation will fail;
> 4) Submit data --> validation fails;
> 5) Select another choice from the ListChoice;
> 6) The form doesn't get updated anymore (and keeps showing old data of
> the recommendation instance that failed validation)
> 

I suppose you're using wantOnSelectionChangedNotifications() to trigger
the refresh? In that case it won't refresh any input entered by the user.
Validation plays no role here because such a form refresh does NOT invoke
the validation logic.

In order to refresh the data and erase what the user has entered, call
clearInput() on the form:

        ListChoice recommendation = new ListChoice("recommendation", ...) {
                protected boolean wantOnSelectionChangedNotifications() {
                        return true;
                }
                protected void onSelectionChanged(Object newSelection) {
                        recommendationForm.clearInput();
                }
        };

--
Kent Tong
Wicket tutorials freely available at http://www.agileskills2.org/EWDW
-- 
View this message in context: 
http://www.nabble.com/CompoundPropertyModel-stops-working-when-form-validation-fails.-tf4562483.html#a13057990
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to