Hi,

You can do this by adding OnChangeAjaxBehavior("change") to each and every
form component.
This way they will send their values to the server as soon as they are
edited. If the value is valid then it will be stored in the model, if not -
only this form component will render its invalid feedback message.

There is no way to store some of the form components' model objects when
submitting a whole form!
But in this case as it has been explained in your previous question here at
users@ the form components will use their 'input' state and the user won't
need to re-enter the values again.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jun 28, 2017 at 2:01 AM, Lon Varscsak <lon.varsc...@gmail.com>
wrote:

> Hey there, so I have a form with many textfields all of which have
> validators on them.  In a situation where I’m creating a “new” record, all
> the fields are blank.  I also have a DropDownChoice object with an
> AjaxFormSubmitBehavior (“change”) attached.
>
> If the user clicks “save” prematurely, obviously there will be a lot of
> errors on the form.  Also if the first thing they do is choose an option in
> the DropDownChoice some of the form values are invalid.  The problem that I
> have is that it seems like even though some of the values (in this case the
> form component bound to the drop down choice) are valid, those values don’t
> make it into the model because of the other invalid values.
>
> Is there a way to circumvent this?  I’m okay with fields that have invalid
> values not making it into their model objects (makes sense most of the
> time), but in this case I want some to not update and some to update.
>
> Thanks for your time,
>
> Lon
>

Reply via email to