2 Replies Latest reply on Jun 18, 2007 1:14 PM by Nick Belaevski

    trying to dynamically open panels HtmlSimpleTogglePanel

    Charles Crouch Expert

      Hi
      I have a HtmlSimpleTogglePanel which I'm building programmatically and then binding into a facelets .xhtml page. The panel contains a number of form elements. What I am trying to enable is that when there is a validation failure that the panel is rendered open on the post back, even if it was closed when the form was originally submitted.

      The first step I took towards this was to try specify the value of the "opened" attribute on the panel as a variable which can then be updated during the validation phase, e.g.

      ValueBinding valueBinding = getApplication().createValueBinding(
       "#{panelsOpen['panel1']}");
       panel1.setValueBinding("opened", valueBinding);


      I've created a panelsOpen map and added one key/value pair ("panel1", Boolean.FALSE) and put it in Session scope.

      As a debugging step I added a HtmlOuputText component to the page as well which displays the value of "#{panelsOpen['panel1']}".

      Now when I initially go to the page I can see that the value of "#{panelsOpen['panel1']}" is false, but the panel itself still renders as open?

      Any ideas why the "opened" variable appears to be being ignored?


      Setup:
      JSF: jsf-1.2_04
      SEAM: 1.1.6.GA
      Facelets: 1.1.12
      JBoss: 4.0.5.GA
      RichFaces: 3.0.1-20070508.013219-45
      Ajax4jsf: 1.1.1-20070508.013219-82
      Browser: Mozilla Firefox 2.0.0.3

      Thanks