aspose file tools*
The moose likes Struts and the fly likes Struts2 autocompleter label and required fields have no effect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 autocompleter label and required fields have no effect" Watch "Struts2 autocompleter label and required fields have no effect" New topic
Author

Struts2 autocompleter label and required fields have no effect

H Gadre
Greenhorn

Joined: Jan 03, 2010
Posts: 3
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" />



[Thumbnail for sample.jpg]

H Gadre
Greenhorn

Joined: Jan 03, 2010
Posts: 3
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

Joined: Jan 03, 2010
Posts: 3
can somebody please help me with this?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 autocompleter label and required fields have no effect