posted 12 years ago
I have a Struts2 input form tag defined as:
<s:radio name="jointAccount" list="#{'yes':'yes','no':'no'}" required="true" cssErrorClass="fv_error"/>
And when I do server side validation in my ActionClass:
if(jointAccount == null || jointAccount.isEmpty()) {
this.addFieldError("jointAccount", "JOINT is required.");
return INPUT;
}
The rendered form element does not have the cssErrorClass:
<input type="radio" name="jointAccount" id="step2_jointAccountyes" value="yes"/><label for="step2_jointAccountyes">yes</label>
<input type="radio" name="jointAccount" id="step2_jointAccountno" value="no"/><label for="step2_jointAccountno">no</label>
I've even tried writing a custom Validator by extending ValidatorSupport, adding the class as a new validator entry in validators.xml and then using that custom validator in the ActionClassName-validation.xml file, and still cannot get the cssErrorClass to render upon a validation error.
Any thoughts?