a4j:support and order of events occurring
asookazian Dec 13, 2007 6:12 PMIn the below code, what order do the events/actions associated with oncomplete, actionListener, and reRender attributes occur? I am trying to reRender a rich:modalPanel when user clicks graphic icon so that it will repull the data for the dataTable (re-exec a method in SFSB that retrieves data). editNote is a js function that shows the modalPanel.
Will this work?
<h:graphicImage id="securityLevelGraphic" value="/img/icon_edit.gif" rendered="#{noteAction.getRenderNoteGraphic(myAuditList.getRowIndex(), 'secLevelApproved') || securityAuditAction.getLoadedNote(myAuditList.getRowIndex(), 'secLevelApproved')}"> <a4j:support event="onclick" oncomplete="editNote(#{myAuditList.getRowIndex()}, 'secLevelApproved')" actionListener="#{noteAction.setCurrentData(myAuditList.getRowIndex(), 'secLevelApproved', myAuditList)}" reRender="noteLogList1, noteLogList2"/> </h:graphicImage>
modalPanel:
<rich:modalPanel id="mpNote" minHeight="200" minWidth="450" height="500" width="500" zindex="2000"> <f:facet name="header"> <a4j:form id="a4jHeaderForm1"> <h:outputText id="headerText1" value=""/> </a4j:form> </f:facet> <h:form id="noteLogList1"> <h:dataTable value="#{noteAction.getNoteLogList()}" var="myRow" rendered="noteAction.getNoteLogList() != null"> <h:column width="400"> <f:facet name="header">NoteText</f:facet> <h:outputText value="#{myRow.noteText}"/> </h:column> <h:column> <f:facet name="header">TimeStamp</f:facet> <h:outputText value="#{myRow.timeStamp}"> <s:convertDateTime dateStyle="short" timeStyle="medium" type="both"/> </h:outputText> </h:column> </h:dataTable> </h:form> <a4j:form id="a4jMainForm1"> <h:panelGrid columns="2" style="vertical-align:middle"> <h:outputText id="description1" value=""/> <BR/> <h:inputTextarea id="noteText1" value="#{noteAction.noteText}" rows="6" cols="50"> <a4j:support event="onkeyup" reRender="out1" /> </h:inputTextarea> <h:inputHidden id="modalPanelName" value="mpNote"/> <h:panelGroup id="out1"> <a4j:commandButton id="submit1" value="submit" action="#{noteAction.submit}" onclick="Richfaces.hideModalPanel('mpNote')" oncomplete="selectFalseCurrentRadioButton()" rendered="#{not empty noteAction.noteText2}" reRender="mainForm"/> </h:panelGroup> <BR/> <a4j:commandButton value="cancel" onclick="Richfaces.hideModalPanel('mpNote');unselectCurrentRadioButton()"/> </h:panelGrid> </a4j:form> </rich:modalPanel>