This tag is used to create the field that is hidden for the user. This is the field that is used to pass the variables from one page to another. It renders the html input element with the type attribute set to "hidden". This component also has the capability to render the id for the component just the same as we have mentioned in the id attribute of the tag. Normally the naming system of JSF renders the id for the component with some additional text, typically with id of the form as prefix. But this component has an attribute forceId which forces the component to render the same id mentioned in the id attribute.
Code Description :
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<f:view> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>t:inputHidden example</title> </head> <body ><center> <t:inputHidden id="ih" value="Hidden field"/> </center></body> </html> </f:view>
Rendered Output :
The code above creates a hidden field in the page that doesn't appear to the user but is used to pass the value from one page to the other escaping from the users view. We can see the blank figure below :
Html Source Code :
This tag contains attributes given below :
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.