Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Struts2 autocompleter label and required fields have no effect

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am developing a Struts 2 web application (struts version 2.0.14). When I use the autocompleter tag the label and required fields seem to be ignored. Has anybody faced similar problem? The rest of the functionality is working properly. But since,

1. It is ignoring the label attribute, I have to define a separate Label component in the HTML form (unlike other struts 2 tags).
2. Whenever the validation fails for this field, I am adding a field error by using the following

addFieldError("organizationByServiceConsumerId.organizationName", "Please specify a valid Service Consumer organization.");

On the client side, it gets displayed as an action error and not as a field error. Please check the image for your reference.

Here is the declaration,

<s:autocompleter label="Customer Name (Your company)"
name="organizationByServiceConsumerId.organizationName"
dataFieldName="organizations"
theme="ajax"
href="%{jsonList}"
cssStyle="width: 200px;"
autoComplete="false"
showDownArrow="false"
loadOnTextChange="true"
required="true" />
sample.jpg
[Thumbnail for sample.jpg]
Sample output
 
H Gadre
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also I forgot to mention adding following section has no impact.

<s:fielderror><s:param value="%{'organizationByServicePConsumerId.organizationName'}" /></s:fielderror>

You can see that the last combobox uses a standard select tag and hence the field error is displayed along with the input component unlike first two cases.
 
H Gadre
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can somebody please help me with this?
 
You can't have everything. Where would you put it?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic