R K
R K

Reputation: 1313

Hidden Variables in JSF

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

The bean:

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

The 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>

Upvotes: 4

Views: 1351

Answers (1)

R K
R K

Reputation: 1313

i found the answer!!! I have got it by the below mentioned approach..

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

Upvotes: 2

Related Questions