繁体   English   中英

JSF ActionListener不会触发

[英]JSF ActionListener doesn't fire

调用函数vcardController.renderModify动作侦听器不会触发(在函数renderModify中,我将变量renderHiddenEdit设置为true),并且editCardForm中的面板不呈现。 有人可以帮助我吗?

<h:form id="editCardForm">
                <p:panel id="editCard"  style="">
                    <p:panel rendered="#{vcardController.renderHiddenEdit}" >
                        <h:inputHidden id="resourceid" value="#{vcardController.resourceId}" />
                        <h:inputHidden id="vcardraw" value="#{vcardController.vcardRaw}" />
                        <h:graphicImage alt="" style="width: 3em;" class="imagesearch" url="#{resource['img:user.svg']}"/>
                    </p:panel>
                </p:panel>
            </h:form>

            <h:form id="viewCardForm">
                <p:panel id="viewCard" style="">
                    <p:panel rendered="#{vcardController.renderHidden}" >
                        <h:inputHidden id="resourceid" value="#{vcardController.resourceId}" />
                        <h:inputHidden id="vcardraw" value="#{vcardController.vcardRaw}" />
                        <p:commandButton
                            id="testmodifica"
                            class="mod nocorner modifycard"
                            value="modify"
                            update=":editCardForm"
                            actionListener="#{vcardController.renderModify}" />
                    </p:panel>
                </p:panel>
            </h:form> 

            <h:form id="formReqEdit" class="formReqEdit" style="display: none;">
                <h:inputHidden id="vcardraw" value="#{vcardController.vcardRaw}" />
                <h:inputHidden id="resourceid" value="#{vcardController.resourceId}" />
                <p:commandButton
                    id="requestForm"
                    style="display: none;"
                    update=":viewCardForm"
                    oncomplete="contactsDOMAction.showCard(xhr, status, args)"
                    actionListener="#{vcardController.activateModifyCard}" />   
            </h:form> 
  1. 如果要渲染“ editCardForm”,则必须在命令按钮的更新参数中放置“ editCardForm”
  2. 好的做法是添加“过程”。 然后,您可以确定来自组件的哪些数据将被发送到bean,在这种情况下,如果只想调用操作侦听器,则为process =“ @ this”。

  3. 拉法·埃尔南德斯(RafaHernández)说的对,如果显示不显示,您要如何按下按钮?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM