Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSF and the fly likes dynamically disabled field lost its content after submitting form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "dynamically disabled field lost its content after submitting form" Watch "dynamically disabled field lost its content after submitting form" New topic
Author

dynamically disabled field lost its content after submitting form

Piotr Siegfried
Greenhorn

Joined: Oct 02, 2008
Posts: 4
Hi all,

I'm still quite new to JSF and right now I have the following problem:

I have a form with several fields, which I use for both registering new user and edit their personal data.
In case of edit, some fields shouldn't be editable (i.e. disabled=true) but their content which were input during registration should still be displayed.

For the editing, if the password to confirm the change is wrong, then the method (activated after a command button is pressed) will return an empty string (String nextPage = ""; ).
As far as I know, the same page should then be displayed once again (and I put some corresponding error message) and it really is. But the problem is that those disabled fields become empty, while others are still containing their text just like before.
How can I retain the content of the disabled fields?

Many thanks in advance!

regards
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"He Man",
Please check your private messages.
-DOM
Piotr Siegfried
Greenhorn

Joined: Oct 02, 2008
Posts: 4
Sorry for the name before
Anyone has any idea regarding my problem?
The main point is why the content of the disabled fields disappear after reloading the page while other available fields still have their content?
Does it have something to do with the disability?
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamically disabled field lost its content after submitting form
 
Similar Threads
disabling/enabling textbox through .css
validator in LookupDispachAction
Javascript + loop
Disabling a text field leads to loss of value
struts2-populating disabled input fields after validation