This content has been marked as final.
Show 1 reply
-
1. Re: Start a4j:status after form validation?
akaine Jul 11, 2010 10:27 PM (in response to mwhitis)It's done without status actually.
I assume databaseStatusModalBox is for displaying results and databaseStatusOutputText is for displaying errors. Then the commandButton would be:
<a4j:commandButton id="addEntitlementButton" action="#{myBean.myAction}" eventsQueue="searchQueue" reRender="databaseStatusOutputText,databaseStatusModalBox" ignoreDupResponses="true" title="Add Entitlement" value="Add Entitlement" type="submit" styleClass="searchButton" oncomplete="#{facesContext.maximumSeverity == null ? 'Richfaces.showModalPanel(\'databaseStatusModalBox\');' : ''}" />
oncomplete always executes "after" the response is received, and our if-else expression guarantees that the the modal panel would appear only if there were no errors during the validation phase.
PS: Delete a4j:status so it wouldn't be executed by default, or if you need it badly for other actions on the page point this commandButton's status attribute to some other id.