This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

whats the significance of hidden variable in JSF ..  RSS feed

 
amit taneja
Ranch Hand
Posts: 814
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi.
can anybody pls tell me whats the significance of Hidden variable in JSF !!!
i mean how we can use it to sustain the value of variables in request scope.

actually in my application, we only wanted to used request scope rather then session scope but things are not working fine way..
when i m selecting the values of combo box (dropdown menu) the value was becoming reset to default (which i have set in action class) each time i try to choose other value from Drop down menu (combo box) i am not able to hold the value
other thing is some time the rowid attached with datatable i use to print the table is not getting ? why

1. so can any body please explain how to retain the value of combobox

2. and also how to managne when combobox is itself depend on other combo box

3. please tell me the cycle of hidden variables (most important question) i mean how they can be used (with small eg. or link) and whats thier significance is in request scope..

I appreciate ranchers if , they can contribute valuable resources and explain the above difficulty i m facing there by also give enlightment to this topic to others ranchers also ...

pls give links to small eg. available on net..

thanks in advance !!!
amit
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In session scope all valuebindings will remain the same during the session. In request scope the valuebindings will be resetted after each renderresponse.

But in the both scopes the component root is the same during the whole session. So rather use component bindings to have control over the values you want to keep in session.

Another way is to use FacesContext.getCurrentInstance().getExternalContext().getSessionMap(). This returns a session-based Map which can be used to store and retrieve objects during the session.

Another way again is to use h:inputHidden or f:attribute to pass values from request to request.
[ October 09, 2006: Message edited by: B L Scholtz ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!