On Thu, Aug 06, 2009 at 07:09:20AM -0700, nytrus wrote:
> 
> John Krasnay wrote:
> > 
> > The isEnabled method only controls form processing on the server. If you
> > can't even type characters in your text field you have something else
> > going on at the browser level.
> > 
> 
> Well usually in a disabled box you cannot type, no matter what browser you
> are using.

I guess I wasn't clear enough. Returning false from the form's isEnabled
method should *not* disable the text field in the browser. It simply
disables the default processing for the form. You should still be able
to enter a value in the text field, but it won't be validated and the
backing model will not be updated.

Perhaps you are mistakenly overriding the text field's isEnabled method
instead. Note that the text field's isEnabled is queried at render time,
well before you know which button was pressed.

> Anyway I think we can let the fields enabled but override the isRequired():
> if the submitting is the rootform just return false. In this way component
> is correctly displayed but validated when submitting the inner form (the one
> to which it belongs).

This might work for you, but be aware it can trip you up too, e.g. other
validators on the components will still be invoked and the models for
components in the nested form will still be updated.

jk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to