File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes struts2-populating disabled input fields after validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2-populating disabled input fields after validation" Watch "struts2-populating disabled input fields after validation" New topic
Author

struts2-populating disabled input fields after validation

mohan kumar r
Ranch Hand

Joined: Jan 19, 2006
Posts: 38
Hi,
Query related to strut2 framework.
we have some fields in a JSP which are already filled in and disabled on form-load.we are using 'ModelDriven' approach for data transfer and validations are in XML file.

On form load, data is as below

User Name :ABC --> disabled
password:_________

after user enters the password and validating the data, no data populated for user name and the text box is empty with disabled.

user name: no data --> disabled
password : ***** error message : password should be alphanumberic

If the input field is disabled,data is not being populated after validation but it is working fine if the field is 'read only'.
Is it struts2 limitation. Please advice.

Thank you
Mohan


mohan
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
Its not a limitation of struts2, its the standard for html. Disabled values are not submitted with the form. I think you'll want to make a hidden input field to store the value if you want it returned with the form.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts2-populating disabled input fields after validation