0 Replies Latest reply on Aug 20, 2012 7:21 PM by Thang Pham

    Bug when mixing dymamic collapse and manual collapse in rich:collapsiblePanel and rich:extendedDataTable

    Thang Pham Newbie

      During dynamic collapse (collapse the panel upon a radio selection event), if I try to collapse the panel manually (by clicking on the top left of the panel), then dynamic collapse stop working.

      Here are codes to reproduce problem:

       

      <h:form id="myForm">
          <rich:collapsiblePanel id="myPanel" expanded="#{myBean.expanded}" switchType="client">
              <rich:extendedDataTable value="#{myBean.foo}" var="item">
                  <rich:column>
                      #{item}
                  </rich:column>
              </rich:extendedDataTable>
              <br/>
              <h:selectOneRadio value="#{myBean.selectedOption}">
                  <a4j:ajax event="click" listener="#{myBean.handleOptionSelect}"
                            render="myForm:myPanel"/>
                  <f:selectItems value="#{myBean.option}"/>
              </h:selectOneRadio>
          </rich:collapsiblePanel>
      
      
      </h:form>
      
      

       

      And in my bean I have

       

      @ManagedBean
      @ViewScoped
      public class MyBean implements Serializable{
      
          private static final String EXPAND = "expand";
          private static final String COLLAPSE = "collapse";
          private List<String> foo;
          private List<SelectItem> option;
          private String selectedFoo;
          private String selectedOption;
          private boolean expanded = true;
      
          public MyBean() {
              foo = new ArrayList<String>();
              foo.add("Harry");
              foo.add("Tom");
              option = new ArrayList<SelectItem>();
              option.add(new SelectItem(EXPAND, EXPAND));
              option.add(new SelectItem(COLLAPSE, COLLAPSE));
          }
      
          public void handleOptionSelect(){
              System.out.println("Start handleOptionSelect");
              if(selectedOption.equals(EXPAND)){
                  expanded = true;
              } else if(selectedOption.equals(COLLAPSE)){
                  expanded = false;
              }
              System.out.println("Finish handleOptionSelect");
          }
          //Setter and getter
      }
      
      

       

      Bug

       

       

      1.

         a. If switchType="client", I click on radio "collapse", the panel collapse correctly. Great, but if I manually expand the panel by clicking on the top left of the panel, the content of the extendedDataTable is EMPTY.

         b. If switchType="ajax" or "server", I click on radio "collapse", the panel collapse correctly. Great, but if I manually expand the panel by clicking on the top left of the panel, now the content of the extendedDataTable is there correctly, but now dynamic collapse NO longer work, meaning if I click on collapse or expand radio, it no longer collapse or expand the panel

       

       

      2. If in 1.a, I switch from extendedDataTable to dataTable, then it work perfectly, but I need extendedDataTable to row selection. (Remember this is with switchType="client", with other switchType, problem still maintain)

       

      I have submit the issue here. Please help fix this

       

      https://issues.jboss.org/browse/RF-12422