Of course you're right, I just got confused.
Since you only have access to a generic IFormComponent I could suggest this work-around:

public void writeSuffix(IMarkupWriter writer, IRequestCycle cycle, IFormComponent component, IValidator validator) {
   if (component instanceof ValidField) {
      //check for required flag
boolean required = ((ValidField)component).getValidator().isRequired();
      if (required) {
         //do your stuff here.
      }
   }
}

The code could of course be refactored to a more compact form, but this should be clearer.
Does this solve the problem?

Goodbye.

Inge Solvoll wrote:

Thanks, but this is not the problem. The problem is that there is no IValidator parameter in the writeLabelSuffix() method of ValidationDelegate. So with the default implementation, there is no way to find out if the field is required in Tapestry 3.0.3.

--

Ivano Pagano.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to