开发者

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>开发者_如何学JAVA;
            ...
        </o:dataTable>
    ...
    </h:form>
...
</ui:composition>


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

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜