You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Marc A. Donis" <ma...@runbox.com> on 2007/11/04 18:12:56 UTC
T5.0.6: validaiton on select
Hi again,
I'm having a problem getting the select component to validate. I do:
<t:select t:validate="required" t:model="model" ... etc />
where model is defined by:
SelectModel model = new SelectModelImpl(new
LinkedList<OptionGroupModel>(), new LinkedList<OptionModel>());
model.getOptions().add(new OptionModelImpl(NO_VALUE_STR, false, null));
model.getOptions().add(new OptionModelImpl("option 1", false, "1"));
model.getOptions().add(new OptionModelImpl("option 2", false, "2"));
which seems very simple, but it does not validate. If I select null in the
list and submit the enclosing form, no validation message is displayed
client-side, and no validation takes place on the server, either.
Thoughts?
Thanks again,
Marc
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5.0.6: validaiton on select
Posted by Josh Canfield <jo...@thedailytube.com>.
Try passing an empty string as the value instead of null.
Are other fields in the form validating correctly?
Josh
On Nov 4, 2007 9:12 AM, Marc A. Donis <ma...@runbox.com> wrote:
> Hi again,
>
> I'm having a problem getting the select component to validate. I do:
>
> <t:select t:validate="required" t:model="model" ... etc />
>
> where model is defined by:
>
> SelectModel model = new SelectModelImpl(new
> LinkedList<OptionGroupModel>(), new LinkedList<OptionModel>());
>
> model.getOptions().add(new OptionModelImpl(NO_VALUE_STR, false, null));
> model.getOptions().add(new OptionModelImpl("option 1", false, "1"));
> model.getOptions().add(new OptionModelImpl("option 2", false, "2"));
>
>
> which seems very simple, but it does not validate. If I select null in
> the
> list and submit the enclosing form, no validation message is displayed
> client-side, and no validation takes place on the server, either.
>
> Thoughts?
>
> Thanks again,
> Marc
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.