0
votes

based on this example:

              <a4j:commandButton value="Submit"
                        action="#{mappedAction}"
                        eventsQueue="#{eventsQueue}"
                        reRender="#{myId}noteArea"
                        onclick="this.disabled=true"
                        oncomplete="#{facesContext.maximumSeverity == null ? '' : 'this.disabled=false'}" />

I'm trying to show and hide a modal panel based on the validation

                <a4j:commandButton value="Submit"
                        action="#{mappedAction}"
                        eventsQueue="#{eventsQueue}"
                        reRender="#{myId}noteArea"
                        oncomplete="#{facesContext.maximumSeverity == null ? '' : rich:component(modalConvalida).hide()}"
                        onclick="#{rich:component(modalConvalida)}.show()"

/>

Where modalConvalida is a ui:param passed into my facelet composite component, but I can't manage to get the syntax right. the panel shows onclick, but it doesn't get hidden in the oncomplete.

If I put an alert in the second branch of the ? operator I can see that it gets executed, though.

1

1 Answers

0
votes

Done:

                <a4j:commandButton value="Submit"
                        action="#{mappedAction}"
                        eventsQueue="#{eventsQueue}"
                        reRender="#{myId}noteArea"
                        onclick="#{rich:component(modalConvalida)}.show()"
                        oncomplete="#{rich:component(modalConvalida)}.hide()"/>

Thanks anyway