6 Replies Latest reply on Dec 9, 2010 11:37 AM by ashish joshi

    rich:simpleTogglePanel - opened ignored after user selection

    W K Newbie

      I've got a rich:simpleTogglePanel whose opened attribute is bound to a backing bean. The panel is rerendered based on some other action on the page and the panel displays based on the opened attribute.

      The problem is that after I manually Show/Hide the panel, all subsequent rerenders use the opened state based on what was selected, not based on the opened attribute. The backing bean action does get called, but the state is never used. Shouldn't a rerender cause the opened attribute to be used and not the last client selection? If the current behaviour is by design is there any way to achieve what I want?

      Using RichFaces 3.2.2.GA. Trivial example follows:


      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       <a4j:form id="myForm">
       <a4j:commandButton action="#{toggleBean.toggle}" id="myButton" reRender="myOutputPanel" value="Re-render toggle panel"/>
       <a4j:outputPanel id="myOutputPanel">
       Opened? #{toggleBean.opened}
       <rich:simpleTogglePanel id="myTogglePanel" opened="#{toggleBean.opened}" switchType="ajax">
       <f:facet name="closeMarker">
       <f:facet name="openMarker">

      Backing Bean (Session scope)
      public class ToggleBean {
       private boolean opened = false;
       public boolean isOpened() {
       return opened;
       public void toggle() {
       opened = !opened;