You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thierry Leveque <tl...@gmail.com> on 2009/04/17 16:05:41 UTC

Validation of multiple textfield in a dynamic ListView

Hi

I have a validation problem that I can figure out how to do:

I have build a dynamic table for the user to enter data into text fields.
I am using the ListView component and some ajax behavior.
Users can add and delete rows of the table. Everything works well, except
for the validation.

One of the column in the table is a port number. And guess what, port values
must be unique in the table.

How can I do that kind of validation?

I was thinking of using a Form Validator, but the problem is that form
components are added and deleted dynamically.

Any idea?

Thierry

Re: Validation of multiple textfield in a dynamic ListView

Posted by Igor Vaynberg <ig...@gmail.com>.
however you want. you have the object graph. you can either use a
visitor to locate whatever components you want, or you can keep direct
references, or you can use a visitor to broadcast an event. completely
up to you.

-igor

On Fri, Apr 17, 2009 at 12:44 PM, Thierry Leveque <tl...@gmail.com> wrote:
> Ok, that is a good start.
>
> Now how do I access the form data within that method?
> Is there any documentation on that or any example?
>
> Thanks!
>
> Thierry
> Sent from Montreal, Quebec, Canada
>
> On Fri, Apr 17, 2009 at 14:22, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> override form.onvalidate()
>>
>> -igor
>>
>> On Fri, Apr 17, 2009 at 7:05 AM, Thierry Leveque <tl...@gmail.com>
>> wrote:
>> > Hi
>> >
>> > I have a validation problem that I can figure out how to do:
>> >
>> > I have build a dynamic table for the user to enter data into text fields.
>> > I am using the ListView component and some ajax behavior.
>> > Users can add and delete rows of the table. Everything works well, except
>> > for the validation.
>> >
>> > One of the column in the table is a port number. And guess what, port
>> values
>> > must be unique in the table.
>> >
>> > How can I do that kind of validation?
>> >
>> > I was thinking of using a Form Validator, but the problem is that form
>> > components are added and deleted dynamically.
>> >
>> > Any idea?
>> >
>> > Thierry
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

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


Re: Validation of multiple textfield in a dynamic ListView

Posted by Thierry Leveque <tl...@gmail.com>.
Ok, that is a good start.

Now how do I access the form data within that method?
Is there any documentation on that or any example?

Thanks!

Thierry
Sent from Montreal, Quebec, Canada

On Fri, Apr 17, 2009 at 14:22, Igor Vaynberg <ig...@gmail.com>wrote:

> override form.onvalidate()
>
> -igor
>
> On Fri, Apr 17, 2009 at 7:05 AM, Thierry Leveque <tl...@gmail.com>
> wrote:
> > Hi
> >
> > I have a validation problem that I can figure out how to do:
> >
> > I have build a dynamic table for the user to enter data into text fields.
> > I am using the ListView component and some ajax behavior.
> > Users can add and delete rows of the table. Everything works well, except
> > for the validation.
> >
> > One of the column in the table is a port number. And guess what, port
> values
> > must be unique in the table.
> >
> > How can I do that kind of validation?
> >
> > I was thinking of using a Form Validator, but the problem is that form
> > components are added and deleted dynamically.
> >
> > Any idea?
> >
> > Thierry
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Validation of multiple textfield in a dynamic ListView

Posted by Igor Vaynberg <ig...@gmail.com>.
override form.onvalidate()

-igor

On Fri, Apr 17, 2009 at 7:05 AM, Thierry Leveque <tl...@gmail.com> wrote:
> Hi
>
> I have a validation problem that I can figure out how to do:
>
> I have build a dynamic table for the user to enter data into text fields.
> I am using the ListView component and some ajax behavior.
> Users can add and delete rows of the table. Everything works well, except
> for the validation.
>
> One of the column in the table is a port number. And guess what, port values
> must be unique in the table.
>
> How can I do that kind of validation?
>
> I was thinking of using a Form Validator, but the problem is that form
> components are added and deleted dynamically.
>
> Any idea?
>
> Thierry
>

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