You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by eugenebalt <eu...@yahoo.com> on 2011/04/12 22:23:19 UTC

Form Submission of Disabled-Selected Fields Not Working

I ran into a problem which could be a bug.

I have a field on the form which is disabled (a disabled
CheckBoxMultipleChoice). However, one item in that field is pre-selected, so
it's a Disabled+Selected situation.

There is another Ajax fields that does a target.addComponent() of this
CheckBoxMultipleChoice, but does NOT change the model in any way. The
CheckBoxMultipleChoice's model should remain the same.

When the form is submitted in onSubmit(), I get NULLs from getInput(),
getValue(), and getModelObject() on that disabled CheckBoxMultipleChoice
when the Ajax component is altered in any way. As I said, there should not
be any changes to the CheckBoxMultipleChoice's model, because I don't do a
setModel(..) anywhere. What I expect to get is a Model holding the
pre-selected disabled item, which was the case prior to Form.onSubmit(). It
should be the initial pre-selections which should not have been erased.

If I don't touch the Ajax component, then it's fine, I get the correct
selection from retrieving the model of my disabled CheckBoxMultipleChoice.

Any thoughts appreciated. Thanks

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-Submission-of-Disabled-Selected-Fields-Not-Working-tp3445600p3445600.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Form Submission of Disabled-Selected Fields Not Working

Posted by eugenebalt <eu...@yahoo.com>.
Thanks for the reply. That's what I suspected.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-Submission-of-Disabled-Selected-Fields-Not-Working-tp3445600p3447600.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Form Submission of Disabled-Selected Fields Not Working

Posted by Martin Grigorov <mg...@apache.org>.
This is how HTML works - submitting a form will not submit any disabled
elements in the that form.

On Tue, Apr 12, 2011 at 10:23 PM, eugenebalt <eu...@yahoo.com> wrote:

> I ran into a problem which could be a bug.
>
> I have a field on the form which is disabled (a disabled
> CheckBoxMultipleChoice). However, one item in that field is pre-selected,
> so
> it's a Disabled+Selected situation.
>
> There is another Ajax fields that does a target.addComponent() of this
> CheckBoxMultipleChoice, but does NOT change the model in any way. The
> CheckBoxMultipleChoice's model should remain the same.
>
> When the form is submitted in onSubmit(), I get NULLs from getInput(),
> getValue(), and getModelObject() on that disabled CheckBoxMultipleChoice
> when the Ajax component is altered in any way. As I said, there should not
> be any changes to the CheckBoxMultipleChoice's model, because I don't do a
> setModel(..) anywhere. What I expect to get is a Model holding the
> pre-selected disabled item, which was the case prior to Form.onSubmit(). It
> should be the initial pre-selections which should not have been erased.
>
> If I don't touch the Ajax component, then it's fine, I get the correct
> selection from retrieving the model of my disabled CheckBoxMultipleChoice.
>
> Any thoughts appreciated. Thanks
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Form-Submission-of-Disabled-Selected-Fields-Not-Working-tp3445600p3445600.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>