You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christian Dutaret <cd...@gmail.com> on 2014/08/29 11:41:26 UTC

[5.4-beta-6] Strange behavior with JSR 303 client-side validation and nested beans

Hi list,

I'm using JSR-303 annotations. When validating a field from the page class,
it works as expected, and client-side validation is correctly triggered.

Page.java:

   @NotNull
   @Property
   private String firstName;

Page.tml:

  <t:form t:id="fill">
    <fieldset>
      <t:label for="firstName" />
      <t:textfield t:id="firstName" value="firstName"/>
    </fieldset>

    <fieldset>
      <t:submit />
    </fieldset>
  </t:form>

If I submit the form, client-side validation tells me that first name
should not be empty.

If I try the same, but from a field of a nested bean, then only server-side
validation occurs, not client-side.

Page.java:

   @Property
   private Person person = new Person();

Page.tml:

  <t:form t:id="fill" validate="person">
    <fieldset>
      <t:label for="firstName" />
      <t:textfield t:id="firstName" value="person.firstName"/>
    </fieldset>

    <fieldset>
      <t:submit />
    </fieldset>
  </t:form>

Person.java:

   @NotNull
   private String firstName;

I don' know if this was working with earlier versions.

Christian

Re: [5.4-beta-6] Strange behavior with JSR 303 client-side validation and nested beans

Posted by Christian Dutaret <cd...@gmail.com>.
Hi Thiago,

Switched to beta-16 and yes it is fixed.
Thanks

Christian


2014-08-29 15:01 GMT+02:00 Thiago H de Paula Figueiredo <th...@gmail.com>
:

> On Fri, 29 Aug 2014 06:41:26 -0300, Christian Dutaret <
> cdtapestry@gmail.com> wrote:
>
>  Hi list,
>>
>
> Hi!
>
> Have you tried one of the latest betas, available in the Apache Maven
> staging repository? I recall fixing something like that.
>
>
>  I'm using JSR-303 annotations. When validating a field from the page
>> class,
>> it works as expected, and client-side validation is correctly triggered.
>>
>> Page.java:
>>
>>    @NotNull
>>    @Property
>>    private String firstName;
>>
>> Page.tml:
>>
>>   <t:form t:id="fill">
>>     <fieldset>
>>       <t:label for="firstName" />
>>       <t:textfield t:id="firstName" value="firstName"/>
>>     </fieldset>
>>
>>     <fieldset>
>>       <t:submit />
>>     </fieldset>
>>   </t:form>
>>
>> If I submit the form, client-side validation tells me that first name
>> should not be empty.
>>
>> If I try the same, but from a field of a nested bean, then only
>> server-side
>> validation occurs, not client-side.
>>
>> Page.java:
>>
>>    @Property
>>    private Person person = new Person();
>>
>> Page.tml:
>>
>>   <t:form t:id="fill" validate="person">
>>     <fieldset>
>>       <t:label for="firstName" />
>>       <t:textfield t:id="firstName" value="person.firstName"/>
>>     </fieldset>
>>
>>     <fieldset>
>>       <t:submit />
>>     </fieldset>
>>   </t:form>
>>
>> Person.java:
>>
>>    @NotNull
>>    private String firstName;
>>
>> I don' know if this was working with earlier versions.
>>
>> Christian
>>
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: [5.4-beta-6] Strange behavior with JSR 303 client-side validation and nested beans

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 29 Aug 2014 06:41:26 -0300, Christian Dutaret  
<cd...@gmail.com> wrote:

> Hi list,

Hi!

Have you tried one of the latest betas, available in the Apache Maven  
staging repository? I recall fixing something like that.

> I'm using JSR-303 annotations. When validating a field from the page  
> class,
> it works as expected, and client-side validation is correctly triggered.
>
> Page.java:
>
>    @NotNull
>    @Property
>    private String firstName;
>
> Page.tml:
>
>   <t:form t:id="fill">
>     <fieldset>
>       <t:label for="firstName" />
>       <t:textfield t:id="firstName" value="firstName"/>
>     </fieldset>
>
>     <fieldset>
>       <t:submit />
>     </fieldset>
>   </t:form>
>
> If I submit the form, client-side validation tells me that first name
> should not be empty.
>
> If I try the same, but from a field of a nested bean, then only  
> server-side
> validation occurs, not client-side.
>
> Page.java:
>
>    @Property
>    private Person person = new Person();
>
> Page.tml:
>
>   <t:form t:id="fill" validate="person">
>     <fieldset>
>       <t:label for="firstName" />
>       <t:textfield t:id="firstName" value="person.firstName"/>
>     </fieldset>
>
>     <fieldset>
>       <t:submit />
>     </fieldset>
>   </t:form>
>
> Person.java:
>
>    @NotNull
>    private String firstName;
>
> I don' know if this was working with earlier versions.
>
> Christian


-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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