i dont think its that new, but maybe changed since youve written your wiki.

-igor

On Thu, Aug 6, 2009 at 8:24 AM, John Krasnay<[email protected]> wrote:
> Oh, is that new? Perhaps my example on the wiki is indeed fubar.
>
> jk
>
> On Thu, Aug 06, 2009 at 08:14:51AM -0700, Igor Vaynberg wrote:
>> no, when a form's isenabled() returns false then all of its
>> descendants are also disabled. when a formcomponent is disabled it
>> adds disabled="disabled" attribute, so you wont be able to use it in
>> the browser.
>>
>> -igor
>>
>> On Thu, Aug 6, 2009 at 7:32 AM, John Krasnay<[email protected]> wrote:
>> > 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: [email protected]
>> > For additional commands, e-mail: [email protected]
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> 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]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to