4 Replies Latest reply on Jun 12, 2009 11:25 AM by Franco Fernandes

    Open a modal panel on page load

    Franco Fernandes Novice

      I want to open a modal panel when a page is first called and also start a new Seam conversation.

      So I tried these 2 options

      <s:button id="createCatalogItem" value="Create catalog item" view="/catalogItemEdit.xhtml" propagation="none" >
       <f:param name="catalogItemId"/>
       <f:param name="catalogItemProductClassId"/>
       <rich:componentControl for="chooseProductClassPanel" attachTo="createCatalogItem" attachTiming="immediate" operation="show" event="onclick"/>
      </s:button>
      
      
      <a4j:commandButton id="createCatalogItem2"
       value="Create catalog item"
       action="#{catalogItemHome.createNewCatalogItem()}" >
       <f:param name="catalogItemId"/>
       <f:param name="catalogItemProductClassId"/>
       <s:conversationPropagation type="none"/>
       <a4j:support event="onclick" oncomplete="#{rich:component('chooseProductClassPanel')}.show()"/>
      </a4j:commandButton>
      
      



      In both cases, the modal panel displays briefly but does not stay open.

      What is the right way to do this ?