Strange Modal Panel Behaviour
qaelbdj Apr 15, 2011 8:48 AMI have a problem with a modal panel. I can't close it, but just sometimes. I do the following:
- Press the command link to open the modal (it opens ok)
- Press the close button in the modal (it closes ok)
- Repeat 1 (it opens ok)
- Repeat 2 (It does not close!!!)
Sometimes I can open and close more times before it stops working.
Sometimes the modal opens ok but it closes automatically after 0.5 seconds ,, wtf???
Here is my code.
<a4j:commandLink id="btnTestQuery" style="width: 130px;"
styleClass="cmndLinkButton"
onclick="testQuery();"
reRender="dtbParameters, lblInputEmpty, modal_InputDBData"
ajaxSingle="#{true}" value="Test">
</a4j:commandLink>
<a4j:jsFunction name="testQuery"
reRender="ErrorQuery, modal_InputDBData" action="#{extLinkBean.ReadParameters}"
data="#{extLinkBean.errQuery}" ajaxSingle="#{true}"
oncomplete="if (data == 0) {Richfaces.showModalPanel('modal_InputDBData');}
else {Richfaces.showModalPanel('ErrorQuery');}
" />
And modal_inputDBData is
<rich:modalPanel id="modal_InputDBData" height="#{extLinkBean.modalInputHeight}" style="overflow-y:auto;">
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="/resources/imgs/modal/close.png"
styleClass="hidelink"
onclick="Richfaces.hideModalPanel('modal_InputDBData');return false;" />
</h:panelGroup>
</f:facet>
</rich:modalPanel>
In the ReadParameters action I make some validations and if there is an error (flag errQuery) I open modalpanel ErrorQuery, else I open modalpanel modal_InputDBData. In this case I get no error, so what I am trying to open is modal_InputDBData.
Apparently hide command is not working.
I debugged richfaces javascript and hide command is executing, but it ends in an if line with condition "this.shown" , it is undefined and it dies.
Thank you,