Hi Christophe, Could you please give me a sample implementation.
Regards, Jagadesh On Thu, Mar 18, 2010 at 12:39 PM, Christophe Cordenier < christophe.corden...@gmail.com> wrote: > Hi > > Try with fielvalidtorsource service to build your conditional constraints. > > Regards > Christophe cordenier > > Le 18 mars 2010 à 06:59, Jagadesh Paladugula <jagadeshpaladug...@gmail.com> > a écrit : > > > Hi Everyone, >> >> I have a form which is getting generated dynamically based on some values >> in >> database. I want to add validation for a text box based on some condition. >> >> I tried doing some thing like this >> >> <t:textfield t:validate="*${validator}*"></t:textfield> >> >> and added the below method in respective java file >> >> public String getValidator(){ >> if(test for validation condition){ >> return "required"; >> }else{ >> return ""; >> } >> } >> >> I am getting some exception saying *"Could not find a coercion from type >> java.lang.String to type org.apache.tapestry5.FieldValidator."* >> >> From the exception, I understood that it is expecting FieldValidator, but >> I >> am not getting how to initalize a *"required" FieldValidator* and return >> it. >> >> I have one more fix (which I didn't like) >> <t:if test="test for validation"> >> <t:textfield t:validate="*${validator}*"></t:textfield> >> <t:parameter name="else"> >> <t:textfield></t:textfield> >> </t:parameter> >> </t:if> >> >> >> Please Let me know, if there is a way to initalize a FieldValidator. >> >> -- >> Thanks & Regards >> Jagadesh >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Regards Jagadesh