7 Replies Latest reply on Jun 28, 2007 9:59 AM by koenhandekyn

    params in pageflows?

    delphi'sghost

      What I'm trying to do is at the end of a pageflow, go back to the original page that started the page flow, in this case the widgetView page. To do so I need to pass the widgetId as a request parameter so the widgetView knows which widget to display.

      I see from the xml schema that pageflows don't support params anywhere, and since I ended the pageflow, the conversation has completed, so there is no way to access that information.

      Using pages.xml navigation, I can pass param values on the redirects. Should I just use pages.xml for my pageflow exit actions and end the conversation from there?

      Anyone have any other suggestions on how to pass information out of the pageflow? Should I create a Jira to suggest the idea of params in pageflows?

        • 1. Re: params in pageflows?
          ellenzhao

          You may want to try this in your backing bean: design a method which takes the widgetId as parameter. The Seam enhanced EL can take parameter for backing bean method calls, so it really does not matter whether you use it pages.xml or jpdl files.

          • 2. Re: params in pageflows?
            gavin.king

            Have you tried just using redirect.captureCurrentView() / returnToCapturedView()?

            • 3. Re: params in pageflows?
              delphi'sghost

              enhanzo :

              I think the problem there is that the information has to cross the conversation boundary. The bean receiving the param needs to exist in the next page's conversation, and the entity containing the param exists only in the previous conversation which we probably just ended and is therefore no longer available.

              Gavin :

              Interesting suggestion, having a quick look through the source code for the redirect component, it looks like it might work. My only problem is that again, it's a question of spanning conversation boundaries, and being on the right view when I capture it. I usually start conversations in pages.xml so it seems impossible for the redirect component to be in the right conversation when I capture the view since the conversation is only started on the first page of the pageflow.

              If I do it it on the old view, the one I want to capture, then the new conversation hasn't started so the redirect component will not be in the new conversation. @Begin annotations don't help since the conversation only begins after it has executed, so while it may capture the right view, it will be in the wrong conversation.

              In general, regarding the issue of conversation boundaries and passing information across those boundaries, I've found the only practical and effective way is to use parameters to pass Ids around.

              • 4. Re: params in pageflows?
                koenhandekyn

                i have a related question : i want users to be able to configure there 'home' page ( the main page they use ). i tried to use an EL statement in a redirect statement inside "pages.xml" but it doesn't get resolved ???

                any suggestions on how to have a the home page stored inside the session and navigate to that page each time we want to send the user to his 'home' ???



                <page view-id="/singleSignOn.xhtml"
                action="#{identity.login}">
                <navigation from-action="#{identity.login}">

                <redirect view-id="#{homePage}"/>


                • 5. Re: params in pageflows?
                  delphi'sghost

                  I think view-ids are used as identifiers as much as a url, hence there is no EL interpolation done on them. If you notice, anywhere a view is referenced for redirection, the parameters for the view are separate as opposed to part of the view-id.

                  I did think about my problem and whether EL offered a solution as a way to pass params. Begin able to write:

                  <redirect view="/pages/viewItem.xhtml?itemId=#{item.id}"/>
                  


                  would be cool, but impossible I think.

                  However, I think it should be possible to do what you want by returning the view-id from an action method :

                  @In
                  private String homePage;
                  
                  void returnHome() {
                   return homePage;
                  }
                  
                  


                  • 6. Re: params in pageflows?
                    delphi'sghost

                    Oviously that should have been :

                    String returnHome() {
                     return homePage;
                    }
                    


                    • 7. Re: params in pageflows?
                      koenhandekyn

                      indeed that was my ' backup ' solution. i have a problem though with some pages where navigation ?has? to be controlled from the pages.xml

                      the following example to illustrate

                      <page view-id="/login.xhtml">
                       <navigation from-action="#{identity.login}">
                       <rule if="#{identity.loggedIn}">
                       <redirect view-id="/home.xhtml"/>
                       </rule>
                       </navigation>
                       </page>


                      here, the identity.login build in SEAM action triggers a method with the following signature : public boolean authenticate() { } --> there is no way (as far as i know) to return a page id in this case ?????