2 Replies Latest reply on Mar 18, 2008 5:50 PM by Lewis Graham

    rich:panel hide / show with JavaScript

    Lewis Graham Newbie

      How is it possible to hide / show a rich:panel using JavaScript. In fact any component???

      Thanks

      Lewis

        • 1. Re: rich:panel hide / show with JavaScript
          Sergey Smirnov Master

          Why not just pure CSS ?

          • 2. Re: rich:panel hide / show with JavaScript
            Lewis Graham Newbie

            I probably wasn't clear enough on what I want to do.

            For various reasons, we are jusing JSP instead of XHTML + Facelets. We can't use XHTML since some of the components the application uses just don't render properly if they render at all.

            Here is the scenario: when a user clicks on a button I re-render some part of the page - normal a4j stuff so far.

            Whilst the re-rendering occurs an exception happens in the application.

            The rich:messages component must be AFTER the part of the page which causes the exception otherwise the exception will not be seen by the rich:messages component - because the exception is caused by the render phase.

            But I want the exception to be seen at the top of the page, not the bottom.

            So I need to make the top bit disappear after it has just appeared.

            Doing another ajax request doesn't work as all of the messages in the JSF framework are then trashed as part of the new lifecycle. So I have to make everything happen in 1 render of the page: ajax request, render top bit, render messages, if messages are rendered make top bit disappear until messages bit is closed.

            So basically, I need to put some javascript into the rich:panel which will cause the another rich:panel to disappear if the second one is rendered.

            Thanks

            Lewis