Inconsistent rendering of ModalPanel
dandausch Feb 26, 2010 2:55 PMI have a fairly simple requirement:
- delete a row from the extendedDataTable which involves invoking a web service and removing the row for session cache and redisplaying the exdataTbl
I have looked at many examples and have actually implemented (in a similar manner) a modalPanel in another part of the app. The issue is with the modalPanel that is displayed to confirm the user action - it only sometimes displays the correct details, sometimes it is blank and sometimes it is the previous row selection. I am using version 3.3.2.SR1
My command link on a column in the extendedDataTable is as follows:
<a4j:commandLink id="deleteButton" ajaxSingle="true"
action="#{AcrViewController.verifyDeleteSelection}"
oncomplete="#{rich:component('myViewDeleteAccLvl')}.show();"
reRender="myViewDeleteAccLvlDiv">
<f:setPropertyActionListener value="#{myacls}"
target="#{AcrViewController.selectedAssignedAclForDelete}"/>
<h:graphicImage value="/images/delete_clear.gif" class="command-button-icon" alt="Delete Access Level"/>
</a4j:commandLink>
Note that I have a setPropertyActionListener to set the selected table row object (#myacls) in the backing bean and threw in an additional call to 'verifyDeleteSelection' to double check. From my debug statements it looks like both are being called on a consistent basis.
Here is a portion of my modalPanel:
<rich:modalPanel id="#{modalpanelid}" autosized="true" width="370">
<f:facet name="header">
<h:panelGroup>
<h:outputText>Delete Access Level</h:outputText>
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:graphicImage value="images/close.png" style="cursor:pointer"
onclick="Richfaces.hideModalPanel('#{modalpanelid}')"/>
</f:facet>
<div id="myViewDeleteAccLvlDiv">
<h:form>
<a4j:outputPanel ajaxRendered="true" id="editSecurityGroupForm">
<h:panelGrid columns ="1">
<h:outputText id="delete1" styleClass="modal-item"
value="Your are about to delete Access Level:">
</h:outputText>
<h:outputText id="delete2" styleClass="modal-item"
value="#{AcrViewController.selectedAssignedAclForDelete.aclDesc}">
</h:outputText>
<h:outputText id="delete3" styleClass="modal-item"
value="for #{AcrViewController.selectedAssignedAclForDelete.firstNm} #{AcrViewController.selectedAssignedAclForDelete.lastNm}.">
</h:outputText>
<p/>
<h:outputText id="delete4" styleClass="modal-item"
value="Please Confirm."></h:outputText>
</h:panelGrid> ------------------------------------------------ This issue seems to be with the call value="#{AcrViewController.selectedAssignedAclForDelete.aclDesc and the other data calls. It seems that it is calling these methods only some of the time. I am rendering the 'div' section as described in other articles and tutorials. It seems to get messed up when the cancel button is called as below: <h:panelGrid columns ="2"> <a4j:commandButton value="Confirm" action="#{AcrViewController.deleteAccess}" oncomplete="javascript:showUserMessagesPopup(#{AcrViewController.userMessageCount});Richfaces.hideModalPanel('#{modalpanelid}');" limitToList="true" reRender="#{rerenderlist}"> </a4j:commandButton> <a4j:commandButton value="Cancel" oncomplete="Richfaces.hideModalPanel('#{modalpanelid}');" limitToList="true" reRender="#{smallrerenderlist}"> </a4j:commandButton> </h:panelGrid> I have literally been trying to resolve this for several days. It should be easy! Any thoughts or help would be appreciated. Thanks.