aspose 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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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
    
    1

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?