File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Bakya Lakshmi
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
change to session scope from request scope.

Let me know if im not clear

Regards
Rajani
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I changed to session scope.
Its displaying the values now.
Thanks a lot...
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i checked in the net its better to not to use session scope.
Please use hidden variables for the issue

Regards
Bhagavan
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic