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 to access JSF hidden field value? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How to access JSF hidden field value? " Watch "How to access JSF hidden field value? " New topic
Author

How to access JSF hidden field value?

Gautam Ry
Ranch Hand

Joined: Dec 30, 2008
Posts: 41
Hi,
i am very new to JSF. My question
say a form has the following JSF component
<h:inputHidden id= "emp_id_val" value="AX"/>

How can I access the hidden field value using request scope?.

As we know, if the component is as below instead of the above.
<input type="hidden" name="emp_id_val" value="AX"/>
we can use <%=request.getParameter("emp_id_val")%>

I am looking for the similar kind of thing for JSF component.

regards
Gautam


Brajendra Mathema
Ranch Hand

Joined: Jun 02, 2009
Posts: 39
hi

you can use value=#{requestScope['managed bean in requestscope'].attribute}


brajen
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

You could even bind the hidden field to an instance of a JSF HtmlInputHidden and extract it that way, although I prefer the previous posters approach:

http://java.sun.com/javaee/javaserverfaces/1.1/docs/api/

-Cameron McKenzie

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to access JSF hidden field value?
 
Similar Threads
passing hidden field value to backing bean
How to get the managed bean property value inside the javascript method in facelets?
Dynamic class type declaration
javascript value to JSF
Example to make JSF work with DWR