modal panel once again...
hrbaer Jul 16, 2009 11:28 AMHey,
I'm having some problems with a modal panel.
I have a few on my side, but there is one which doesn't work well.
F.ex. 2 commandButtons:
<a4j:commandButton id="buttonKommentar" onclick="Richfaces.showModalPanel('kommentar', {top:'30px', left:'70px', height:'250', width:'400'});" value="add comment" /> <a4j:commandButton id="buttonLoeschen" onclick="Richfaces.showModalPanel('loeschen', {top:'30px', left:'70px', height:'250', width:'400'}, reRender='tmp');" value="Löschen" />
The first one shows the modal panel when clicking on it, the second doesn't.
Here the code for the modal panels:
<rich:modalPanel id="kommentar"> <f:facet name="header"> <h:outputText value="add comment" /> </f:facet> <h:form> <p> blabla<br><br> <h:inputTextarea value="#{mb.newKommentar}" cols="65" rows="5" /> </p> <h:panelGrid columns="1" columnClasses="alignRight" styleClass="maxWidth"> <h:panelGroup> <h:commandButton value="Abbrechen" onclick="Richfaces.hideModalPanel('kommentar')" /> <h:commandButton value="Kommentar erfassen" actionListener="#{mb.addKommentar}" /> </h:panelGroup> </h:panelGrid> </h:form> </rich:modalPanel> (...) <rich:modalPanel id="loeschen" rendered="#{mb.show}"> <div id="tmp"> <f:facet name="header"> <h:outputText value="löschen" /> </f:facet> <h:form> <p> Do you really ...?<br> </p> <h:panelGrid columns="1" columnClasses="alignRight" styleClass="maxWidth"> <h:panelGroup> <h:commandButton value="Abbrechen" onclick="Richfaces.hideModalPanel('loeschen')" /> <h:commandButton value="Bestätigen" actionListener="#{mb.loeschen}" /> </h:panelGroup> </h:panelGrid> </h:form> </div>
The only difference beetween these two modal panels is that the second one has an attribute rendered which is in the beginning false. I can't change this otherwise the getter for some properties in my modal panel returns a NullPointerException because there aren't all informations laoded yet.
So could this be the problem? Or am I doing something else wrong?
One pretty interesting fact:
When I first click on the Button for the first modal panel and click after that on the button for the second modal pannel everythin works.
But when I start clicking on the second button I get this error:
panel has no properties hideModalPanel()modalPanel.js.jsf (line 108) showModalPanel(function())modalPanel.js.jsf (line 107) showModalPanel("loeschen", Object top=30px left=70px height=250 width=400, "tmp")modalPanel.js.jsf (line 108) onclick(click clientX=0, clientY=0)fondsgesellschaft... (line 1) [Break on this error] invoke(function(){panel.component.show(event,opts);});};Richfaces.hideModalPanel...
Any ideas?
Thanks in advance!