I have converted a TP3 application to TP4 recently. In the TP3
implementation, I was using a subclass of ValidationDelegate to add the
'*' symbols to required text input fields. Howerver, after migrating
over to TP4, the '*' characters stopped showing up.
I ran the code in the debugger, and was able to verify that my delegate
was indeed being invoked, but that the IValidator parameter is always
null. The delegate looks like this:
public class AltosDelegate extends ValidationDelegate {
public void writeSuffix(IMarkupWriter writer, IRequestCycle cycle,
IFormComponent component, IValidator validator) {
writer.end();
if ( validator != null && validator.isRequired()) {
writer.begin("span");
writer.attribute( "class", "required-marker");
writer.print("*");
writer.end();
}
}
}
In the .page file, I have tried one or more of the following:
<bean name="delegate" class="com.altosresearch.web.AltosDelegate"
property="delegate"/>
<bean name="required"
class="org.apache.tapestry.form.validator.Required"/>
<bean name="email" class="org.apache.tapestry.form.validator.Email"/>
<component id="userLoginName" type="TextField">
<binding name="value" value="userLoginName"/>
<binding name="displayName" value="literal:Login Name"/>
<binding name="validator" value="{beans.required}"/>
</component>
as well as:
<bean name="delegate" class="com.altosresearch.web.AltosDelegate"
property="delegate"/>
<bean name="required"
class="org.apache.tapestry.form.validator.Required"/>
<bean name="email" class="org.apache.tapestry.form.validator.Email"/>
<component id="userLoginName" type="TextField">
<binding name="value" value="userLoginName"/>
<binding name="displayName" value="literal:Login Name"/>
<binding name="validators" value="validators:required}"/>
</component>
So what is the TP4 way for me to add the '*' characters to my required
fields? I've been looking at the WorkBench examples from T4-beta9 for
guidance...but nothing so far.
Thanks,
jason
--
Jason L. Buberel - [EMAIL PROTECTED] - http://www.buberel.org
JabberID:[EMAIL PROTECTED] - m:+16504831989