CollapseAllRows in hierarchicalTable

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

CollapseAllRows in hierarchicalTable

Postby nicola.gioia » Thu Aug 30, 2007 9:33 am

I've seen the code necessary to do the collapseAllRows method.
I've a problem with this method.
The calls to resizeAndRepaint and doLayout of this method cause a big cascade of method calls.
There is a problem to change the implementation avoiding the calls when all rows are already collapsed (for example with the subsequent strategy)?
I cannot do this overriding the method in a subclass because the setBatchProcessing(boolean) is not visible.

Thanks!

Code: Select all
   @Override
   public void collapseAllRows() {
      setBatchProcessing(true);
      boolean oldFlag = isScrollRowWhenRowHeightChanges();
      setScrollRowWhenRowHeightChanges(false);
      boolean collapsed = false;
      try {
         for (int i = 0; i < getRowCount(); i++) {
            if(isExpanded(i)){
               collapseRow(i);
               collapsed = true;
            }
         }
      } finally {
         if(collapsed){
            resizeAndRepaint();
            super.doLayout();
         }
         setBatchProcessing(false);
         setScrollRowWhenRowHeightChanges(oldFlag);
      }
   }
nicola.gioia
 
Posts: 60
Joined: Tue Sep 20, 2005 6:57 am

Postby JIDE Support » Thu Aug 30, 2007 9:43 am

I will fix it to use your code. It makes sense to do so. I will also make setBatchProcessing/isBatchProcessing to protected as I think user will need these two methods in overriden methods. I will also apply the same logic to expandAllRows.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby JIDE Support » Thu Aug 30, 2007 8:00 pm

Just so you know, 2.1.3.01 patch is released to fix this bug.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby nicola.gioia » Fri Aug 31, 2007 12:36 am

Thanks for quick reply.
nicola.gioia
 
Posts: 60
Joined: Tue Sep 20, 2005 6:57 am


Return to Product Suggestions

Who is online

Users browsing this forum: Google [Bot] and 12 guests