4 Replies Latest reply on Jul 28, 2006 2:04 AM by dgallego

    Hiding a portlet

    dgallego

      Hi, is it possible to hide a portlet dynamically?
      I have tried overriding the render() method, but it doesn't work at all.

      Thanks :)

        • 1. Re: Hiding a portlet

          try to throw a portlet exception and configure the portal in jboss-portal.sar/conf/config.xml such as it does not display portlets that throw exceptions.

          pretty ugly I know, but should work.

          • 2. Re: Hiding a portlet
            dgallego

            Hehehe. I have tried launching an UnavailableException, but when I execute the page for the first time, it displayes: "No portlet available". If I refresh the page, the portlet dissappears, good, but I can't make it visible again.

            Thanks ;)

            • 3. Re: Hiding a portlet

              You can't have this sort of behaviour from within the portlet, as the portal will have already called it and its render, decorated it, and aggregated it on to the page.

              • 4. Re: Hiding a portlet
                dgallego

                Thanks so much :).