• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to access JSF hidden field value?

 
Gautam Ry
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

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


brajen
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic