Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-13916

Nested collapsibleSubTable only collapse ten row BUG

    Details

      Description

      I do have 3 levels of collapsibleSubTable nesting, but i click collapse link only collapse ten row!

      my bean:

      public class TestKnow {  
        
          public List<TopLevel> getTopLevelDatas(){  
              List<TopLevel> result = new ArrayList<TopLevel>(1);  
              result.add(new TopLevel());  
              return result;  
          }  
        
          public static class TopLevel {  
        
              private String title;  
        
              private List<SecondLevel> secondLevels = new ArrayList<SecondLevel>(1);  
        
              public TopLevel() {  
                  this.title = "test Top level";  
                  secondLevels.add(new SecondLevel("test second Level"));  
              }  
        
              // geter and seter ...            
          }  
        
          public static class SecondLevel {  
              private String title;  
        
              private List<String> thirdLevels = new ArrayList<String>(15);  
        
              public SecondLevel(String title) {  
                  this.title = title;  
                  for (int i = 0; i < 15; i++) {  
                      thirdLevels.add(String.valueOf(i));  
                  }  
              }  
              // geter and seter ...                  
          }  
      }  
      

      my page:

              <r:dataTable value="#{testKnow.topLevelDatas}" var="_topLevel">  
        
                  <r:column>  
                      <r:collapsibleSubTableToggler for="sbtb2"/>  
                      <h:outputText value="#{_topLevel.title}"/>  
                  </r:column>  
        
                  <r:collapsibleSubTable id="sbtb2" value="#{_topLevel.secondLevels}" var="_sencondLevel">  
        
                      <r:column>  
                          <r:collapsibleSubTableToggler for="sbtb3"/>  
                          <h:outputText value="#{_sencondLevel.title}"/>  
                      </r:column>  
        
                      <r:collapsibleSubTable id="sbtb3" value="#{_sencondLevel.thirdLevels}" var="_thirdLevel">  
                          <r:column>  
                              <h:outputText value="#{_thirdLevel}"/>  
                          </r:column>  
                      </r:collapsibleSubTable>  
        
                  </r:collapsibleSubTable>  
              </r:dataTable>  
       

      Solve :

      i found this Bug in richfaces-4.5.0.Final.jar/resources/org.richfaces/collapsible-subtable.js

              var element = function() {  
                  if (! this.isNested) {  
                      //use parent tbody as parent dom elem  
                      return $(document.getElementById(this.id)).parent();  
                  } else {  
                      var regex = new RegExp(this.id + "\\:\\d\\:b");  
                      return $(document.getElementById(this.id)).parent().find("tr").filter(function() {  
                          return this.id.match(regex);  
                      });  
                  }  
              };  
       
      var regex = new RegExp(this.id + "\\:\\d\\:b");  // ten row id is  :"j_idt61:0:sbtb2:0:sbtb3:10:b" so  not match !!!!!!!
      

      change to :

      var regex = new RegExp(this.id + "\\:\\d+\\:b");

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cooper_lyt cooper lee
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 30 minutes
                  30m
                  Remaining:
                  Remaining Estimate - 30 minutes
                  30m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified