It's the same behavior regardless of whether or not your using ajax. I
thought initially it was an ajax only exception, but it's not.

On Wed, Feb 18, 2015 at 3:45 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 18 Feb 2015 14:12:21 -0200, George Christman <
> gchrist...@cardaddy.com> wrote:
>
>  I can finally replicate the bug so it can be fixed :)
>>
>
> Thanks!
>
>  Okay when you have a form loop with formstate="iteration" and there is a
>> serverside validation error, the last row's textfield value becomes the
>> first row's textfield value.
>>
>
> Are you sure this works with AJAX in 5.3.8? Or without AJAX in 5.4?
>
>
>
>> Code to replicate bug.
>>
>>     <t:form t:id="form">
>>         <t:errors/>
>>         <t:loop source="testObject.testObject2s" value="testObject2"
>> formstate="iteration">
>>             Price <t:textfield value="testObject2.price"
>> validate="required"/>
>>         </t:loop>
>>         <t:submit value="Submit"/>
>>     </t:form>
>>
>> public class AjaxValidationBug {
>>
>>     @Component(id = "form")
>>     private Form form;
>>
>>     @Property
>>     private TestObject testObject;
>>
>>     @Property
>>     private TestObject2 testObject2;
>>
>>     @Inject
>>     private AjaxResponseRenderer ajaxResponseRenderer;
>>
>>     public void onPrepare() {
>>         if (testObject == null) {
>>             testObject = new TestObject();
>>
>>             testObject.getTestObject2s().add(new TestObject2());
>>             testObject.getTestObject2s().add(new TestObject2());
>>         }
>>     }
>>
>>     public void onValidateFromForm() {
>>         for (TestObject2 testObject2 : testObject.getTestObject2s()) {
>>             if (testObject2.getPrice().compareTo(BigDecimal.ONE) > 0) {
>>                 form.recordError("price must be greater than one");
>>             }
>>         }
>>     }
>>
>>     public void onSuccessFromForm() {
>>         System.out.println("success");
>>     }
>>
>>     public class TestObject {
>>
>>         private List<TestObject2> testObject2s;
>>
>>         private boolean confirm;
>>
>>         public boolean isConfirm() {
>>             return confirm;
>>         }
>>
>>         public void setConfirm(boolean confirm) {
>>             this.confirm = confirm;
>>         }
>>
>>         public List<TestObject2> getTestObject2s() {
>>             if (testObject2s == null) {
>>                 testObject2s = new ArrayList<>();
>>             }
>>             return testObject2s;
>>         }
>>
>>         public void setTestObject2s(List<TestObject2> testObject2s) {
>>             this.testObject2s = testObject2s;
>>         }
>>
>>     }
>>
>>     public class TestObject2 {
>>
>>         private BigDecimal price;
>>
>>         public BigDecimal getPrice() {
>>             return price;
>>         }
>>
>>         public void setPrice(BigDecimal price) {
>>             this.price = price;
>>         }
>>
>>     }
>>
>> }
>>
>>
>> On Tue, Feb 17, 2015 at 9:42 PM, George Christman <
>> gchrist...@cardaddy.com>
>> wrote:
>>
>>
>>> On Feb 17, 2015 8:26 PM, "Thiago H de Paula Figueiredo" <
>>> thiag...@gmail.com> wrote:
>>> >
>>> > On Tue, 17 Feb 2015 17:56:00 -0200, George Christman <
>>> gchrist...@cardaddy.com> wrote:
>>> >
>>> >> Thiago, could you please reopen this issue again.
>>> >
>>> >
>>> > Done.
>>> Thanks
>>> >
>>> >
>>> >> We are experiencing an
>>> >> issue where 1 field continues to lose it's value on validation.
>>> >
>>> >
>>> > Could you please provide the code and template you're using that
>>> reproduces this?
>>>
>>> I'm going to put together a test case tomorrow for you guys.
>>> >
>>> >
>>> >> To help debug this issue, could you provide me with a code snippet
>>> that
>>> I
>>> >> could use to see what's in the validation tracker?
>>>
>>> >
>>> >
>>> > Hmm, I guess you need to inspect the validation tracker object
>>> directly.
>>>
>>> Yeah that's what I was thinking, do you know how I could inspect it?
>>> >
>>> >
>>> > --
>>> > Thiago H. de Paula Figueiredo
>>> > Tapestry, Java and Hibernate consultant and developer
>>> > http://machina.com.br
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> > For additional commands, e-mail: users-h...@tapestry.apache.org
>>> >
>>>
>>>
>>
>>
>>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Reply via email to