may may
may may

Reputation: 1

Action of a4j:commandLink not fire after modalPanel close

I would like to call the action after click the commandLink and that choose ok to confirm and fire the action in the commandlink. But I could only open a modalPanel and close it. But the action is not invoked in the a4j:commandLink. May I ask how could I fire the action after choose "OK" of the modalPanel?

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

Upvotes: 0

Views: 71

Answers (1)

Vincent Passau
Vincent Passau

Reputation: 822

Did you try to transform the OK button into a a4j:commandButton and move the action on the OK button ?

You could save the "deleteValue" in your bean with an actionListener and effectively delete it if the user clicks "OK".

Upvotes: 0

Related Questions