You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nicolas Bouillon <ni...@bouillon.net> on 2015/04/30 09:07:26 UTC

[T5.4] Problem with form fields in a loop

Hi,

I've got an issue with a form containing a loop which contains text fields.

When the validation fails server side, the page is supposed to be
re-rendered with the incorrect values filled in. But in this case, the
field which is repeated will be filled with the last value entered in the
repeated field.

I've created a JIRA issue about that
https://issues.apache.org/jira/browse/TAP5-2475 with a sample project. I
tried to find what is the problem in Tapestry source code, but I can't find
out why the validationTracker is not set with the correct field label and
field value on each loop iteration, and how to fix that.

Any hints ?

Thanks.

Nicolas.

Re: [T5.4] Problem with form fields in a loop

Posted by Nicolas Bouillon <ni...@bouillon.net>.
Great, thank you!

2015-04-30 12:16 GMT+02:00 Dimitris Zenios <di...@gmail.com>:

> Also you dont need to build by hand.You can get it from apache staging repo
>
>         <repository>
>             <id>apache-staging</id>
>             <url>https://repository.apache.org/content/groups/staging/
> </url>
>         </repository>
>
> On Thu, Apr 30, 2015 at 1:16 PM, Dimitris Zenios <
> dimitris.zenios@gmail.com>
> wrote:
>
> > There was also a bug for this
> > https://issues.apache.org/jira/browse/TAP5-2391
> >
> > so please close your bug since its a duplicate and already fixed
> >
> > Dimitris Zenios
> >
> > On Thu, Apr 30, 2015 at 1:14 PM, Nicolas Bouillon <ni...@bouillon.net>
> > wrote:
> >
> >> Indeed, i've built the latest beta tag (5.4-beta-31) and the bug is
> >> corrected.
> >>
> >> Thanks
> >>
> >> 2015-04-30 11:40 GMT+02:00 Nicolas Bouillon <ni...@bouillon.net>:
> >>
> >> > I'm using the lastest in maven central, 5.4-beta-26
> >> >
> >> > 2015-04-30 11:17 GMT+02:00 Dimitris Zenios <dimitris.zenios@gmail.com
> >:
> >> >
> >> >> This has been fixed in the latest snapshot.What version of 5.4 are
> you
> >> >> using?
> >> >>
> >> >> On Thu, Apr 30, 2015 at 11:49 AM, Nicolas Bouillon <
> >> nicolas@bouillon.net>
> >> >> wrote:
> >> >>
> >> >> > I know the same field component is reused. I have used this kind of
> >> >> > structures (field in loop) extensively in a previous project on
> >> Tapestry
> >> >> > 5.3 without any problems. That's for sure a regression between 5.3
> >> and
> >> >> 5.4,
> >> >> > probably caused by the removal of the redirection after validation
> >> >> failure
> >> >> > in a form.
> >> >> >
> >> >> > Thank you for the workaround, that would be useful if the bug
> cannot
> >> be
> >> >> > fixed fast enough. But your demos seems to run on Tapestry 5.3.7...
> >> have
> >> >> > you checked that works on 5.4 beta ?
> >> >> >
> >> >> > 2015-04-30 10:35 GMT+02:00 Lance Java <la...@googlemail.com>:
> >> >> >
> >> >> > > The problem is that the same field is reused for each loop
> >> iteration.
> >> >> See
> >> >> > > here for a workaround using a FieldSnapshot to record the errors.
> >> >> > >
> >> >> > > http://t5stitch-lazan.rhcloud.com/mapbindingdemo
> >> >> > >
> >> >> >
> >> >>
> >> >
> >> >
> >>
> >
> >
>

Re: [T5.4] Problem with form fields in a loop

Posted by Dimitris Zenios <di...@gmail.com>.
Also you dont need to build by hand.You can get it from apache staging repo

        <repository>
            <id>apache-staging</id>
            <url>https://repository.apache.org/content/groups/staging/</url>
        </repository>

On Thu, Apr 30, 2015 at 1:16 PM, Dimitris Zenios <di...@gmail.com>
wrote:

> There was also a bug for this
> https://issues.apache.org/jira/browse/TAP5-2391
>
> so please close your bug since its a duplicate and already fixed
>
> Dimitris Zenios
>
> On Thu, Apr 30, 2015 at 1:14 PM, Nicolas Bouillon <ni...@bouillon.net>
> wrote:
>
>> Indeed, i've built the latest beta tag (5.4-beta-31) and the bug is
>> corrected.
>>
>> Thanks
>>
>> 2015-04-30 11:40 GMT+02:00 Nicolas Bouillon <ni...@bouillon.net>:
>>
>> > I'm using the lastest in maven central, 5.4-beta-26
>> >
>> > 2015-04-30 11:17 GMT+02:00 Dimitris Zenios <di...@gmail.com>:
>> >
>> >> This has been fixed in the latest snapshot.What version of 5.4 are you
>> >> using?
>> >>
>> >> On Thu, Apr 30, 2015 at 11:49 AM, Nicolas Bouillon <
>> nicolas@bouillon.net>
>> >> wrote:
>> >>
>> >> > I know the same field component is reused. I have used this kind of
>> >> > structures (field in loop) extensively in a previous project on
>> Tapestry
>> >> > 5.3 without any problems. That's for sure a regression between 5.3
>> and
>> >> 5.4,
>> >> > probably caused by the removal of the redirection after validation
>> >> failure
>> >> > in a form.
>> >> >
>> >> > Thank you for the workaround, that would be useful if the bug cannot
>> be
>> >> > fixed fast enough. But your demos seems to run on Tapestry 5.3.7...
>> have
>> >> > you checked that works on 5.4 beta ?
>> >> >
>> >> > 2015-04-30 10:35 GMT+02:00 Lance Java <la...@googlemail.com>:
>> >> >
>> >> > > The problem is that the same field is reused for each loop
>> iteration.
>> >> See
>> >> > > here for a workaround using a FieldSnapshot to record the errors.
>> >> > >
>> >> > > http://t5stitch-lazan.rhcloud.com/mapbindingdemo
>> >> > >
>> >> >
>> >>
>> >
>> >
>>
>
>

Re: [T5.4] Problem with form fields in a loop

Posted by Dimitris Zenios <di...@gmail.com>.
There was also a bug for this
https://issues.apache.org/jira/browse/TAP5-2391

so please close your bug since its a duplicate and already fixed

Dimitris Zenios

On Thu, Apr 30, 2015 at 1:14 PM, Nicolas Bouillon <ni...@bouillon.net>
wrote:

> Indeed, i've built the latest beta tag (5.4-beta-31) and the bug is
> corrected.
>
> Thanks
>
> 2015-04-30 11:40 GMT+02:00 Nicolas Bouillon <ni...@bouillon.net>:
>
> > I'm using the lastest in maven central, 5.4-beta-26
> >
> > 2015-04-30 11:17 GMT+02:00 Dimitris Zenios <di...@gmail.com>:
> >
> >> This has been fixed in the latest snapshot.What version of 5.4 are you
> >> using?
> >>
> >> On Thu, Apr 30, 2015 at 11:49 AM, Nicolas Bouillon <
> nicolas@bouillon.net>
> >> wrote:
> >>
> >> > I know the same field component is reused. I have used this kind of
> >> > structures (field in loop) extensively in a previous project on
> Tapestry
> >> > 5.3 without any problems. That's for sure a regression between 5.3 and
> >> 5.4,
> >> > probably caused by the removal of the redirection after validation
> >> failure
> >> > in a form.
> >> >
> >> > Thank you for the workaround, that would be useful if the bug cannot
> be
> >> > fixed fast enough. But your demos seems to run on Tapestry 5.3.7...
> have
> >> > you checked that works on 5.4 beta ?
> >> >
> >> > 2015-04-30 10:35 GMT+02:00 Lance Java <la...@googlemail.com>:
> >> >
> >> > > The problem is that the same field is reused for each loop
> iteration.
> >> See
> >> > > here for a workaround using a FieldSnapshot to record the errors.
> >> > >
> >> > > http://t5stitch-lazan.rhcloud.com/mapbindingdemo
> >> > >
> >> >
> >>
> >
> >
>

Re: [T5.4] Problem with form fields in a loop

Posted by Nicolas Bouillon <ni...@bouillon.net>.
Indeed, i've built the latest beta tag (5.4-beta-31) and the bug is
corrected.

Thanks

2015-04-30 11:40 GMT+02:00 Nicolas Bouillon <ni...@bouillon.net>:

> I'm using the lastest in maven central, 5.4-beta-26
>
> 2015-04-30 11:17 GMT+02:00 Dimitris Zenios <di...@gmail.com>:
>
>> This has been fixed in the latest snapshot.What version of 5.4 are you
>> using?
>>
>> On Thu, Apr 30, 2015 at 11:49 AM, Nicolas Bouillon <ni...@bouillon.net>
>> wrote:
>>
>> > I know the same field component is reused. I have used this kind of
>> > structures (field in loop) extensively in a previous project on Tapestry
>> > 5.3 without any problems. That's for sure a regression between 5.3 and
>> 5.4,
>> > probably caused by the removal of the redirection after validation
>> failure
>> > in a form.
>> >
>> > Thank you for the workaround, that would be useful if the bug cannot be
>> > fixed fast enough. But your demos seems to run on Tapestry 5.3.7... have
>> > you checked that works on 5.4 beta ?
>> >
>> > 2015-04-30 10:35 GMT+02:00 Lance Java <la...@googlemail.com>:
>> >
>> > > The problem is that the same field is reused for each loop iteration.
>> See
>> > > here for a workaround using a FieldSnapshot to record the errors.
>> > >
>> > > http://t5stitch-lazan.rhcloud.com/mapbindingdemo
>> > >
>> >
>>
>
>

Re: [T5.4] Problem with form fields in a loop

Posted by Nicolas Bouillon <ni...@bouillon.net>.
I'm using the lastest in maven central, 5.4-beta-26

2015-04-30 11:17 GMT+02:00 Dimitris Zenios <di...@gmail.com>:

> This has been fixed in the latest snapshot.What version of 5.4 are you
> using?
>
> On Thu, Apr 30, 2015 at 11:49 AM, Nicolas Bouillon <ni...@bouillon.net>
> wrote:
>
> > I know the same field component is reused. I have used this kind of
> > structures (field in loop) extensively in a previous project on Tapestry
> > 5.3 without any problems. That's for sure a regression between 5.3 and
> 5.4,
> > probably caused by the removal of the redirection after validation
> failure
> > in a form.
> >
> > Thank you for the workaround, that would be useful if the bug cannot be
> > fixed fast enough. But your demos seems to run on Tapestry 5.3.7... have
> > you checked that works on 5.4 beta ?
> >
> > 2015-04-30 10:35 GMT+02:00 Lance Java <la...@googlemail.com>:
> >
> > > The problem is that the same field is reused for each loop iteration.
> See
> > > here for a workaround using a FieldSnapshot to record the errors.
> > >
> > > http://t5stitch-lazan.rhcloud.com/mapbindingdemo
> > >
> >
>

Re: [T5.4] Problem with form fields in a loop

Posted by Dimitris Zenios <di...@gmail.com>.
This has been fixed in the latest snapshot.What version of 5.4 are you
using?

On Thu, Apr 30, 2015 at 11:49 AM, Nicolas Bouillon <ni...@bouillon.net>
wrote:

> I know the same field component is reused. I have used this kind of
> structures (field in loop) extensively in a previous project on Tapestry
> 5.3 without any problems. That's for sure a regression between 5.3 and 5.4,
> probably caused by the removal of the redirection after validation failure
> in a form.
>
> Thank you for the workaround, that would be useful if the bug cannot be
> fixed fast enough. But your demos seems to run on Tapestry 5.3.7... have
> you checked that works on 5.4 beta ?
>
> 2015-04-30 10:35 GMT+02:00 Lance Java <la...@googlemail.com>:
>
> > The problem is that the same field is reused for each loop iteration. See
> > here for a workaround using a FieldSnapshot to record the errors.
> >
> > http://t5stitch-lazan.rhcloud.com/mapbindingdemo
> >
>

Re: [T5.4] Problem with form fields in a loop

Posted by Nicolas Bouillon <ni...@bouillon.net>.
I know the same field component is reused. I have used this kind of
structures (field in loop) extensively in a previous project on Tapestry
5.3 without any problems. That's for sure a regression between 5.3 and 5.4,
probably caused by the removal of the redirection after validation failure
in a form.

Thank you for the workaround, that would be useful if the bug cannot be
fixed fast enough. But your demos seems to run on Tapestry 5.3.7... have
you checked that works on 5.4 beta ?

2015-04-30 10:35 GMT+02:00 Lance Java <la...@googlemail.com>:

> The problem is that the same field is reused for each loop iteration. See
> here for a workaround using a FieldSnapshot to record the errors.
>
> http://t5stitch-lazan.rhcloud.com/mapbindingdemo
>

Re: [T5.4] Problem with form fields in a loop

Posted by Lance Java <la...@googlemail.com>.
The problem is that the same field is reused for each loop iteration. See
here for a workaround using a FieldSnapshot to record the errors.

http://t5stitch-lazan.rhcloud.com/mapbindingdemo