File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes How restore disabled textbox values if there is any validation error in current page. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How restore disabled textbox values if there is any validation error in current page." Watch "How restore disabled textbox values if there is any validation error in current page." New topic
Author

How restore disabled textbox values if there is any validation error in current page.

Bakya Lakshmi
Greenhorn

Joined: Dec 10, 2008
Posts: 9
I have two pages in JSF. The first page values are populated to next page. But some fields are not editable (disabled) in next page. If there is any validation error the disabled textbox values are lost. how to restore the values of disabled text fields.
rajanikanth bhagavan kanth
Ranch Hand

Joined: May 20, 2008
Posts: 78
Hi,
change to session scope from request scope.

Let me know if im not clear

Regards
Rajani
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Originally posted by rajanikanth bhagavan kanth:
Hi,
change to session scope from request scope.

Let me know if im not clear

Regards
Rajani


That has much more impact and is bad for user experience.

Either just use readonly rather than disabled, or use h:inputHidden to silently tranfer disabled values anyway.
Bakya Lakshmi
Greenhorn

Joined: Dec 10, 2008
Posts: 9
Hi,

I changed to session scope.
Its displaying the values now.
Thanks a lot...
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
The session scope isn't the holy grail. They should forbid people to suggest to misuse the session scope to transfer request scoped (yes, request scoped!) data.
rajanikanth bhagavan kanth
Ranch Hand

Joined: May 20, 2008
Posts: 78
i checked in the net its better to not to use session scope.
Please use hidden variables for the issue

Regards
Bhagavan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How restore disabled textbox values if there is any validation error in current page.