3 Replies Latest reply on Feb 15, 2011 9:50 AM by ibstmt

    Modal Panel and EJB load

    ibstmt Newbie

      I have a problem where the main method of my EJB gets fired whenever I call a Modal Panel. Here are the snippets of my application:



         <page view-id="/main.xhtml" login-required="true" action="#{myEJB.load}">

              <begin-conversation join="true"/>

              <param name="callerUrl" required="false" />

              <param name="callerSupportsMultipleResult" required="false" />


                  <rule if-outcome="home">

                      <redirect view-id="/main.xhtml"/>


                  <rule if-outcome="back">

                      <redirect view-id="/main.xhtml"/>










      public class MyEJB {


          public void load() {

             (bunch of initialization code)






           <rich:menuItem submitMode="none" value="Edit">

                          <a4j:support event="onclick" immediate="true"       






          <rich:modalPanel id="editModal" autosized="true">

              <f:facet name="header">

                  <h:outputText value="Edit" style="padding-right:15px;" />


              <ui:include src="editForm.xhtml" />





                      <rich:menuItem submitMode="none" value="Save"  icon="/images/save.png">

                          <a4j:support event="onclick" immediate="true"   



                              oncomplete="#{rich:component('editModal')}.hide()" />   




          <h:panelGrid id="editForm">






      My problem is that every time I choose the Edit menu option on main.xhtml, the load() method in myEJB gets fired when the modal appears (before I close the modal, not after). The modal panel comes up correctly, no problems, but I don't need the load() method to fire every time. I can't remove the action reference in pages.xml, though, because that's needed for other functionality.