【问题标题】:Action of a4j:commandLink not fire after modalPanel closemodalPanel 关闭后 a4j:commandLink 的动作不触发
【发布时间】:2019-05-29 07:19:18
【问题描述】:

我想在单击 commandLink 后调用该操作,然后选择确定以确认并触发 commandlink 中的操作。但我只能打开一个 modalPanel 并关闭它。但是在 a4j:commandLink 中没有调用该操作。请问modalPanel选择“OK”后怎么触发动作?

<a4j:commandLink
     action="#{confManager.deleteValue(deleteValue)}"
     onclick="#{rich:component('confirmation')}.show();return false"
     value="#{messages.deleteLabel}"
     title="#{messages.deleteHint}"
     propagation="none"
     reRender="systemPropertiesTable">
</a4j:commandLink>

<rich:modalPanel id="confirmation" width="210" height="100">
    <f:facet name="header">#{messages.systemPropertyConfirmDialogHeader} 
    </f:facet>
          <h:panelGrid>
            <h:panelGrid columns="2">
              <p><h:outputText value="#{messages.systemPropertyConfirmDialogContent}" /></p>
            </h:panelGrid>
            <h:panelGroup>
              <input type="button" value="OK"
                     onclick="#{rich:component('confirmation')}.hide();submit();return false" />
              <input type="button" value="Cancel"
                     onclick="#{rich:component('confirmation')}.hide();return false" />
        </h:panelGroup>
    </h:panelGrid>
</rich:modalPanel>

【问题讨论】:

    标签: jsf jsf-1.1


    【解决方案1】:

    您是否尝试将 OK 按钮转换为 a4j:commandButton 并移动 OK 按钮上的操作?

    您可以使用 actionListener 将“deleteValue”保存在您的 bean 中,并在用户单击“确定”时有效地删除它。

    【讨论】:

      猜你喜欢
      • 2013-05-25
      • 2014-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-27
      • 2018-09-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多