Hi Jack, Maybe Bean Validation can help you here
http://tapestry.apache.org/bean-validation.html <http://tapestry.apache.org/bean-validation.html> Best, Nikola On Tue, May 24, 2011 at 5:30 PM, <jackkuros...@w9z.org> wrote: > I know I can make a field required like this: > <t:textfield value="myTextField" validate="required"/> > > But how can I make it programmatically determine whether or not the field > is required? > > I have tried: > > <t:textfield value="myTextField" validate="${validationText}"/> > > public String getValidationText() { > if (fieldRequired) { return "required" } > else { return ""} > > > But that doesn't seem to work. Tapestry says it can't coerce a string into > a Validator. > > Am I overlooking something simple or is there a better approach to > accomplish this? > > Jack > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >