You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by lyo <li...@hotmail.com> on 2005/10/16 13:58:21 UTC

How to make my component client side validate?

Hi friends:

     I have a input tapestry4 component, the code is:

<component id="testf" type="TextField">
    <binding name="value" value="visit.bigdecimal"/>
    <binding name="translator" value="translator:number,pattern=#.#"/>
    <binding name="validators" 
value="validators:required,min=2,max=100.123456234563456734563456356734567456784
567456784567845675678456785678"/>
    <binding name="displayName" value="literal:Big Decimal Field"/>
  </component>

It will validate on the server side. Now I want to make this component validate 
on the client side. So I add a element :
"<binding name="value" value="clientValidationEnabled"/> ".  The code will 
change to this:

<component id="testf" type="TextField">
    <binding name="value" value="clientValidationEnabled"/>
    <binding name="value" value="visit.bigdecimal"/>
    <binding name="translator" value="translator:number,pattern=#.#"/>
    <binding name="validators" 
value="validators:required,min=2,max=100.123456234563456734563456356734567456784
567456784567845675678456785678"/>
    <binding name="displayName" value="literal:Big Decimal Field"/>
  </component>

But it don't validate in the client side ;-( . It remain validate on the server 
side, why?  How to make my component validation on the client side? Thks!


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


Re: How to make my component client side validate?

Posted by Leonardo Quijano Vincenzi <le...@dtqsoftware.com>.
Is there any planned way to validate only portions of a form??

I'm thinking of a big form for an object, which has a list of 
child-objects inside (for example a Employee form with a list of phone 
numbers), with
buttons to add phones to the main form. It'd be good to perform 
validation on these child objects without validating the parent form.

-- 
Ing. Leonardo Quijano Vincenzi
Director Técnico
DTQ Software


Howard Lewis Ship escribió:

>Put:
>
>    <binding name="clientValidationEnabled" value="true"/>
>
>On you *** Form *** component.  This single parameter on the Form
>controls validation for all components inside the Form.
>
>  
>



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


Re: How to make my component client side validate?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Put:

    <binding name="clientValidationEnabled" value="true"/>

On you *** Form *** component.  This single parameter on the Form
controls validation for all components inside the Form.

On 10/16/05, lyo <li...@hotmail.com> wrote:
> Hi friends:
>
>      I have a input tapestry4 component, the code is:
>
> <component id="testf" type="TextField">
>     <binding name="value" value="visit.bigdecimal"/>
>     <binding name="translator" value="translator:number,pattern=#.#"/>
>     <binding name="validators"
> value="validators:required,min=2,max=100.123456234563456734563456356734567456784
> 567456784567845675678456785678"/>
>     <binding name="displayName" value="literal:Big Decimal Field"/>
>   </component>
>
> It will validate on the server side. Now I want to make this component validate
> on the client side. So I add a element :
> "<binding name="value" value="clientValidationEnabled"/> ".  The code will
> change to this:
>
> <component id="testf" type="TextField">
>     <binding name="value" value="clientValidationEnabled"/>
>     <binding name="value" value="visit.bigdecimal"/>
>     <binding name="translator" value="translator:number,pattern=#.#"/>
>     <binding name="validators"
> value="validators:required,min=2,max=100.123456234563456734563456356734567456784
> 567456784567845675678456785678"/>
>     <binding name="displayName" value="literal:Big Decimal Field"/>
>   </component>
>
> But it don't validate in the client side ;-( . It remain validate on the server
> side, why?  How to make my component validation on the client side? Thks!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>


--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: How to make my component client side validate?

Posted by Shing Hing Man <ma...@yahoo.com>.
Instead of 
 <binding name="value"
 value="clientValidationEnabled"/>

please try
<binding name="clientValidationEnabled" value="true"/>

Shing

--- lyo <li...@hotmail.com> wrote:

> Hi friends:
> 
>      I have a input tapestry4 component, the code
> is:
> 
> <component id="testf" type="TextField">
>     <binding name="value" value="visit.bigdecimal"/>
>     <binding name="translator"
> value="translator:number,pattern=#.#"/>
>     <binding name="validators" 
>
value="validators:required,min=2,max=100.123456234563456734563456356734567456784
> 567456784567845675678456785678"/>
>     <binding name="displayName" value="literal:Big
> Decimal Field"/>
>   </component>
> 
> It will validate on the server side. Now I want to
> make this component validate 
> on the client side. So I add a element :
> "<binding name="value"
> value="clientValidationEnabled"/> ".  The code will 
> change to this:
> 
> <component id="testf" type="TextField">
>     <binding name="value"
> value="clientValidationEnabled"/>
>     <binding name="value" value="visit.bigdecimal"/>
>     <binding name="translator"
> value="translator:number,pattern=#.#"/>
>     <binding name="validators" 
>
value="validators:required,min=2,max=100.123456234563456734563456356734567456784
> 567456784567845675678456785678"/>
>     <binding name="displayName" value="literal:Big
> Decimal Field"/>
>   </component>
> 
> But it don't validate in the client side ;-( . It
> remain validate on the server 
> side, why?  How to make my component validation on
> the client side? Thks!
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 


Home page :
  http://uk.geocities.com/matmsh/index.html


	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

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