>From: Daniel del Río <[EMAIL PROTECTED]> 
>
> Hello, 
> Someone knows if it is possible to add a commonsValidation component in a 
> clay 
> component? 
> 
> <component jsfid="mycomponent" extends="inputText">
>        <element id="validator" renderId="1" jsfid="s:commonsValidator">
>            <attributes>
>                <set name="type" value="required"/>
>                <set name="client" value="true"/>
>            </attributes>
>        </element>
>    </component>      
> 

You will need to register a validator using the "validator" node. 

<component jsfid="mycomponent" extends="inputText">
        <validator jsfid="s:commonsValidator">
            <attributes>
                <set name="type" value="required"/>
                <set name="client" value="true"/>
            </attributes>
        </validator>
</component>      

If you want to use multiple commonsValidators on a single component, you 
will need to use different jsfid's.  The jsfid is the "key" for the Set of 
validators.


Consider:

<component jsfid="mycomponent" extends="inputText">
        <validator jsfid="s:commonsValidatorRequired">
            <attributes>
                <set name="type" value="required"/>
                <set name="client" value="true"/>
            </attributes>
        </validator>
        <validator jsfid="s:commonsValidatorEmail">
            <attributes>
                <set name="type" value="email"/>
                <set name="client" value="true"/>
            </attributes>
        </validator>

</component>      

There are default alias validators defined.  I  just realized that these don't 
implicitly define the types so you will have to provide the "type".

s:commonsValidatorRequired, s:commonsValidatorMaxlength, 
s:commonsValidatorMinlength, s:commonsValidatorMask, s:commonsValidatorByte, 
s:commonsValidatorShort, s:commonsValidatorInteger, s:commonsValidatorLong, 
s:commonsValidatorFloat, s:commonsValidatorDouble, s:commonsValidatorDate, 
s:commonsValidatorIntRange, s:commonsValidatorFloatRange, 
s:commonsValidatorDoubleRange, s:commonsValidatorCreditCard, 
s:commonsValidatorEmail, s:commonsValidatorUrl

> Thanks in advance. 
> drh. 
> 

Gary

Reply via email to