• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

whats the significance of hidden variable in JSF ..

 
Ranch Hand
Posts: 817
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic