0 Replies Latest reply on Aug 28, 2009 3:16 PM by Dariusz Stachyra

    Problem with InitInstance into modalPanel

    Dariusz Stachyra Newbie

      Hello.


      I have a problem with edit entity in modalPanel. Seam doesn't initialize instance of entity with initInstance(), but Id is not null.


      My modal panel:



      <!--  EDIT MODAL PANEL     -->
           <rich:modalPanel id="editAddress" autosized="true" width="450">
                <f:facet name="header">
                     <h:outputText value="#{messages['address.create']}"
                          style="padding-right:15px;" />
                </f:facet>
                <f:facet name="controls">
                     <h:panelGroup>
                          <h:graphicImage value="/img/close.png" styleClass="hidelink"
                               id="hidelink" />
                          <rich:componentControl for="editAddress" attachTo="hidelink"
                               operation="hide" event="onclick" />
                     </h:panelGroup>
                </f:facet>
                <rich:messages globalOnly="true" />
       
                <!-- HERE IS ENTITY FOR EDIT -->
                <ui:include src="./address.xhtml" />
           </rich:modalPanel>



      MY LIST WITH BUTTON, WHERE MODAL PANEL IS SET TO ACTIVE


      ...
      <!--     SHOW EDIT MODAL PANEL     -->
      <a4j:commandButton id="editButton" image="/img/edit.gif" oncomplete="Richfaces.showModalPanel('myModalWithInclude');" >
               <a4j:actionParam id="addressIdForEdit"  name="addressId" value="#{rowAddress.id}" assignTo="#{addressHome.addressId} "/>
      </a4j:commandButton>


      ...


      This button is in address list, and setup addressId to edit.



      MY BEAN - AddressHome.java



             ...
           public void setAddressId(Long addressId){
                this.addressId=addressId;
                      // addressId is not null, then should init instance with addressId in modal panel 
                initInstance();
           }
              ...



      I used loadInstance, setInstance, setId too.


      Why it doesn't work?
      Any ideas?