5 Replies Latest reply on May 1, 2009 8:44 AM by Nick Belaevski

    Combining Seam's pages.xml and the a4j:include of Ajax4Jsf f

    Todd Gould Novice

      I found the following 2006 post on the Seam forum (http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3992913) that is very similar to what I am lookong for. There does not appear to be any further discussion on this. However, I'm wondering if this ever went anywhere, of if it could be resurfaced as it would be most helpful! Is there better way to create a nested conversation from an <a4j:include> operation?

      Posted: Mon Dec 11, 2006 16:56 PM Post subject: Combinding Seam's pages.xml and the a4j:include of Ajax4Jsf?

      --------------------------------------------------------------------------------

      The pages.xml features have been invaluable for executing actions when a page is loaded. I also see that it now has support for changing the view if a conversation is not active.

      These features are great, but unfortunately on apply to root views. Ajax4Jsf has a include tag that pulls in a page to make up part of the parent page. This included, child page is a normal view-id.

      I would love to see Seam enhance and support this control so that the pages.xml can react to the child view. For example:

      a.xhtml:

      ...
      <aj4:include viewId="/includes/b.xhtml" />...


      And then be able to:

      pages.xml

       <page view-id="/includes/b.xhtml"
       action="#{someBean.onLoad}"
       begin-conversation nested="true" />
      


      Do you think that this would be possible, and if not, what kind of work would be required to integrate this into an extended version of a4j:include?


        • 2. Re: Combining Seam's pages.xml and the a4j:include of Ajax4J
          Todd Gould Novice

          Nick,

          Thank you for the reply. Both appear to be related; but neither mentions conversation management in particular. This is my direct need - to be able to create a nested conversation in response to a user action that utlimately triggers a reRender of an <a4j:include> nested inside an <a4j:outputPanel>. Is anyone aware of how this can be accomplished given that the pages.xml rules do not seem to be applied in this case?

          I'm presently looking into two different approaches to my dilema:

          1) Using an <a4j:support> element nested in the panelMenuItem that will 'immediate' invoke a Seam component whose job it will be to verify (and create as necessary) the nested conversation via the Conversation API....

          2) Potentially do the same manual conversation management via Seam Remoting.

          Does anyone have any thoughts on these approaches and/or ideas for better ones?

          TIA!

          • 3. Re: Combining Seam's pages.xml and the a4j:include of Ajax4J
            Nick Belaevski Master

            You can try to put Seam link just inside panel menu item - set item's mode to "none"; or yes, use a4j:support interacting with Seam component.

            • 4. Re: Combining Seam's pages.xml and the a4j:include of Ajax4J
              Todd Gould Novice

              The embedded link mostly works....

              I have:

               <rich:panelMenuItem mode="none">
               <rich:toolTip value="#{mainController.getContentTooltip( 'abc' )}"/>
               <s:link propagation="nest" value="ABC" action="#{mainController.setContentView( 'abc' )}" reRender="contentPanel" status="mainStatus"/>
               </rich:panelMenuItem>


              This works with two remaining issues:

              1) it always collapses the containing panelMenuGroup. What I was using before never did this; but of course it did not create a nested conversation either....

               <rich:panelMenuItem label="ABC" action="#{mainController.setContentView( 'abc' )}" reRender="contentPanel" status="mainStatus">
               <rich:toolTip value="#{mainController.getContentTooltip( 'abc' )}"/>
               </rich:panelMenuItem>
              


              2) This almost works too well for my desired scenario.... Every click on the panelMenuItem results in a new nested conversation ... as coded. For my scenario, I need to have a nested conversation that is created on the first invocation, but is re-used every time the user re-clicks on the panelMenutItem .... so that they can go back and forth between various portions controlled by other panelMenuItems, but not loose their place when they ultimately return.

              Any thoughts on these issues?

              I'm going to try the a4j:support option next....

              • 5. Re: Combining Seam's pages.xml and the a4j:include of Ajax4J
                Nick Belaevski Master

                BTW, maybe <s:conversationPropagation /> combined with a4j:support/AJAXed rich:panelMenuItem can do the job?...