3 Replies Latest reply on Nov 9, 2005 4:40 AM by giordano

    Sharing data between portlet

      Hi,

      I developed some simple portlets using JBossPortal and MyFaces. I put on a page two or more portlets. All is working but I can't share data between portlets. For instance I have a portlet with an input text component and a button. I write some data in the input text componet and click the button. I am able to view the data on the same portlet but I am not able to view the data on another portlet. Anyone can help me on this topic?

      Thanks and bye,

      Giordano

        • 1. Re: Sharing data between portlet
          schnelzer

          Did you deploy all of your portlets in the same war file (all portlets in one portlet.xml). If so, then it should work if you are using the portlet application scope.

          • 2. Re: Sharing data between portlet

            First off,

            If you're using JBoss Portal Server (and you are) to develop a portal application, you've basically made the following technical decisions:

            * You want to use Sun's JSR168 Portlet specification as a model of how you develop portlets
            * You want to use the JSR168-Portlet API's

            Given these facts, you need to spend some time reviewing the JSR 168 Portlet specification to understand what you get when you opt to use JBoss Portal Server - you can find the spec here

            Having said these things, if you review "PLT.11.1.1 Request Parameter's," you will find the following statement:

            A portlet must not see any parameter targeted to other portlets.


            What this means is that the behavior you are seeing is correct in JBoss Portal - that is, the portlet that responds to the button click (submit?) correctly can see the 'data' (request parameters) but other portlets correctly cannot see the 'data.' If you need to 'share data' - you need to design a scheme in which you place this 'data' in higher scope than request. You can use PortletSession and PortletContext to 'share data' - in order to choose which scope to use, reviewing the JSR168 spec and understanding how each scope behaves is mandatory.

            Good Luck.


            • 3. Re: Sharing data between portlet

              Thank you very much for your reply and for your clarification.

              Giordano