Hidden variables in JSF

I need to get the value of a hidden variable defined in the Facelets file to process a transaction in my bean. I used the line below in the process action method to get a hidden input component. But I get null . How can I get the specified hidden input value?

bean:

 UIInput classNameComponent = (UIInput) event.getComponent().findComponent("className"); 

View:

 <ui:composition template="/templates/content.xhtml"> ... <h:form id="classForm"> ... <o:dataTable id="classTable"> ... <f:facet name="import"> <h:inputHidden id="className" value="com.LoadClass" /> </f:facet> ... </o:dataTable> ... </h:form> ... </ui:composition> 
+4
source share
1 answer

I found the answer !!! I got this using the approach below.

 className = (String) FacesContext.getCurrentInstance().getExternalContext() .getRequestParameterMap().get("classForm:className"); 
+2
source

Source: https://habr.com/ru/post/1339942/


All Articles