1 2 3 4 Previous Next 46 Replies Latest reply on Nov 13, 2007 12:29 PM by pmuir Go to original post
      • 30. Re: Trinidad PPR/Ajax and Seam

        ok - I created a quick test application to demonstrate the Trinidad Dialog / Seam integration. It can be found at:

        https://sourceforge.net/project/showfiles.php?group_id=189858

        To use it:
        This is a simple test app showing Trinidad Dialogs working with the Seam framework. To use, deploy the dist/TestApp.ear to a Jboss 4.0.4 Server.

        http://localhost:8080/testApp

        1) click start (starts a conversation)
        2) click main (loads a second page)
        3) click start dialog
        - the dialog is now open
        4) enter a number and click submit
        5) the number should now be displayed on the page
        opened in #2.
        6) that's it!

        Note1: Assumes MyFaces 1.1.4 and not Sun JSF RI (see MyActionListener if you need to change that)
        Note2: I am using 4.0.4 of JBoss App Server. Don't know if it works with other versions.

        Hope this helps,
        Chris....

        • 31. Re: Trinidad PPR/Ajax and Seam

          Thanks Chris, I am going through your example now. Just one thing, you have a MySQL datasource defined in persistence.xml You should change this to Hypersonic for the example so it will run "out of the box". Just requires a change to DefaultDS as the JNDI name of the datasource in persistence.xml.

          • 32. Re: Trinidad PPR/Ajax and Seam

            Ok I finally have this working. I think it had to do with not having my tags enclosed in a trh:body element which is required to get PPR working. I thought a tr:document would suffice but I guess not?

            Also I have done some limited testing with the Phase Listener/Action Listener provided by earlier in the thread. I don't think these are necessary to get Dialogs working in the most basic sense. If all you need to pop up the window and return a value, a new short-lived conversation will be created by Seam. This is fine since the dialog should not need to know anything about the conversation you came from. This may not be true for other Use Cases where you need to pass a value to the dialog.

            I still can't find a way to propagate the conversation to the dialog window. I have tried the above mentioned Phase Listener and also the s:conversationPropagation tag in Seam's Library. Neither seem to work.

            I would love to hear other ideas on the subject.

            Thanks to both Chris and dajevtic for your help on this.

            • 33. Re: Trinidad PPR/Ajax and Seam

               

              "smithbstl" wrote:

              I still can't find a way to propagate the conversation to the dialog window. I have tried the above mentioned Phase Listener and also the s:conversationPropagation tag in Seam's Library. Neither seem to work.


              The test app I put together does propagate the conversation to the dialog. To see it do the following:

              - on the first page there should be a conversation id on the page
              - this is a temporary conversation
              - click start button
              - a new conversation id should be created
              - this is a long running conversation
              - click main (it's the second button)
              - a new page should open up, the long running cid should be displayed
              - click start dialog
              - the dialog should open up and should be showing the long running cid

              I need a long running conversation and I believe both the PhaseListener and ActionListener are needed. To bad it doesn't seem like we can figure out a way to get it to work without these modifications.

              Maybe something in Seam 1.3. Probably need to use the trinidad-seam extension that the JBoss guys are creating with some added "glue" to get the conversation to propagate correctly across dialogs. Hopefully with this ground work they can think of something a little more elegant than this quick hack.

              Chris....


              • 34. Re: Trinidad PPR/Ajax and Seam

                Chris, I have followed your instructions and am not seeing the conversation propagated.

                1st page has a conversation id (cid) of 1
                2nd page (long running conversation) cid=2
                3rd page(page with dialog link) cid=2
                dialog page cid=4

                I have not changed anything in your project other than the DataSource reference in persistence.xml

                Maybe something in Seam 1.3. Probably need to use the trinidad-seam extension that the JBoss guys are creating with some added "glue" to get the conversation to propagate correctly across dialogs. Hopefully with this ground work they can think of something a little more elegant than this quick hack.


                Where have you heard about a trinidad-seam extenstion? I can't find anything in jira about it.

                • 35. Re: Trinidad PPR/Ajax and Seam
                  dajevtic

                  Please check in my provided listeners, if you are using "conversationId" paramter name od "cid" parameter name...

                  • 36. Re: Trinidad PPR/Ajax and Seam

                    which is correct? coversationId or cid?

                    • 37. Re: Trinidad PPR/Ajax and Seam
                      dajevtic

                      The one that is configured in your components.xml.
                      In your case probably "cid" ?!

                      • 38. Re: Trinidad PPR/Ajax and Seam

                        Ok thanks. It was consistent between components.xml and the phase listener.

                        • 39. Re: Trinidad PPR/Ajax and Seam
                          pmuir

                          Can one of you create a JIRA issue for me? I need to know what the exact problem you are encountering is (and how I can replicate), and what you are doing to solve it and the relevant classes. Then I can roll it into the jboss-seam-trinidad.jar and seamdiscs example. Thanks!

                          • 40. Re: Trinidad PPR/Ajax and Seam

                            I have created the jira, Chris or dajevtic, feel free to add anything I may have left out.

                            http://jira.jboss.com/jira/browse/JBSEAM-1289

                            • 41. Re: Trinidad PPR/Ajax and Seam

                               

                              "smithbstl" wrote:
                              Chris, I have followed your instructions and am not seeing the conversation propagated.

                              1st page has a conversation id (cid) of 1
                              2nd page (long running conversation) cid=2
                              3rd page(page with dialog link) cid=2
                              dialog page cid=4


                              hmmm... note sure what to tell you. It works for me.

                              I have upload another version that is a bit clearer; but this probably isn't the problem.

                              1) Click "Start Conversation"
                              2) Click 2nd Page
                              3) Click start dialog (the conversation id should be the same as shown in #2)

                              Are you using JBoss 4.0.4?

                              Chris....

                              • 42. Re: Trinidad PPR/Ajax and Seam

                                I have modified the JIRA. I can try to answer questions....

                                Chris....

                                • 43. Re: Trinidad PPR/Ajax and Seam
                                  wchico2

                                  Hi,

                                  As of last week Seam 2.0 has become productive. Has the situation changed in any way?

                                  What I noticed is that the original way of propagation of this hack is not possible anymore with Seam 2.0 because the line

                                  Manager.instance().restoreConversation(createParameterMapForConversationRestore(convId));

                                  is not possible anymore due to changes of the Seam API.

                                  So if at least we could save this hack and have Seam 2.0 running with Trinidad with this respect, the next question is which Seam method to use instead of above line. Any ideas?

                                  Thanks,
                                  Wolfgang.

                                  • 44. Re: Trinidad PPR/Ajax and Seam
                                    pmuir

                                    No. I've scheduled the issue however.

                                    Try replacing the line with

                                    ConversationPropagation.instance().setConversatonId(convId);
                                    Manager.instance().restoreConversation();