3 Replies Latest reply on Apr 23, 2009 7:33 PM by apemberton

    Close the portlet programmatically

    bensonfungjava

      Hi,

      I would like to close the portlet window programmatically other than minimize and maximize. I have checked that setWindowState can only minimize and maximize the portlet window, but it cannot close the the portlet window. Can anyone have idea how to close the portlet window programmatically?


      Thanks
      Benson

        • 1. Re: Close the portlet programmatically

          Benson: there are probably a few ways to implement this feature.

          One possible route:
          First, add a custom window state:

          <portlet-app>
           ...
           <custom-window-state>
           <description>Closes the portlet window</description>
           <name>close</name>
           </custom-window-state>
           ...
          </portlet-app>


          Then, implement a custom WindowRenderer that does not display the portlet if it's in 'close' state.

          Good luck,
          Andy

          • 2. Re: Close the portlet programmatically
            bensonfungjava

            Thanks Andy.

            I have gone through the documentation of jboss portal. Unfortunatly, it looks like to me that the documentation doesn't mention how to implement the decoration renderer, window renderer. Could you provide me with more information how to implement renderer?


            Thanks
            Benson

            • 3. Re: Close the portlet programmatically

              Benson: no problem. Remember that the portal is open source, so you can always check out the source code. I'd recommend checking out the 'DivWindowRenderer' class and others.

              Good luck!