2 Replies Latest reply on Sep 23, 2008 4:36 AM by danielk

    PortletInstance in different pages

    danielk

      I tried following:

      ...
      </page>
       <page>
       <page-name>mypage</page-name>
       <properties />
      
       <window>
       <window-name>MyMenue</window-name>
       <instance-ref>MyMenuePortletInstance</instance-ref>
       <region>navigation</region>
       <height>0</height>
       </window>
      
       <page>
       <page-name>mysubpage</page-name>
       <properties />
      
      ...


      My Problem with this, MyMenue can only be viewed in "mypage". On "mysubpage" there is no MyMenuePortlet-Window ? If this is the right behaviour, how can i use the same instance of one portlet in different subpages of one page?

      If i insert the window-tag into each subpage, it seems to me, that each subpage has its own instance of MyMenuePortlet (using Richfaces each MyMenuePortlet will get its own SessionBean)?

      I would greatly appreciate, if someone can help me,

      DanielK

        • 1. Re: PortletInstance in different pages
          peterj

          Try this:

          <page>
           <page-name>mypage</page-name>
           <properties />
           <window>
           <window-name>MyMenue</window-name>
           <instance-ref>MyMenuePortletInstance</instance-ref>
           <region>navigation</region>
           <height>0</height>
           </window>
           <page>
           <page-name>mysubpage</page-name>
           <properties />
           <window>
           <window-name>MyMenue2</window-name>
           <instance-ref>MyMenuePortletInstance</instance-ref>
           <region>navigation</region>
           <height>0</height>
           </window>


          Note that each window has its own name, but they both refer to the same portlet instance.

          • 2. Re: PortletInstance in different pages
            danielk

            Thanks for your answer, but if i do this, i have different SessionBeans for each page, although "instance-ref" directs to the same instance like i mentioned above:

            If i insert the window-tag into each subpage, it seems to me, that each subpage has its own instance of MyMenuePortlet (using Richfaces each MyMenuePortlet will get its own SessionBean)?


            Is there another possibility to do this? Or is it just an error at RichFaces?

            I am confused, because of naming "instance". Is each page really using the same instance (some kind of SingletonPattern), or is each page getting another instance ?

            Thanks in advance,

            DanielK