• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2 form input tag's cssErrorClass is not being rendered for server side validation

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
J Livermore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This has been fixed for Release 2.3.1 - Jira WW-3712
 
J Livermore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For those looking for a work around here is an example:

 
Tongue wrestling. It's not what you think. And here, take this tiny ad. You'll need it.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic