0

我想在单击 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>
4

1 回答 1

0

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

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

于 2019-06-02T09:26:06.890 回答