Changeset c63f0db4 in vaadin


Ignore:
Timestamp:
Nov 28, 2011 11:17:11 AM (3 years ago)
Author:
Henri Sara <henri.sara@…>
Branches:
master, 7.0, 7.1, 7.2, 7.3, 7.4
Children:
ad47ed7b
Parents:
2ae16a43
Message:

#7988 TreeTable.setCollapsed() should not throw NPE if the component has not been rendered yet

svn changeset:22147/svn branch:6.7

Location:
src/com/vaadin/ui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/com/vaadin/ui/Table.java

    r08e8d3b9 rc63f0db4  
    38173817 
    38183818        final Object[][] cells = getVisibleCells(); 
    3819         for (int i = 0; i < cells[CELL_ITEMID].length; i++) { 
    3820             visible.add(cells[CELL_ITEMID][i]); 
     3819        // may be null if the table has not been rendered yet (e.g. not attached 
     3820        // to a layout) 
     3821        if (null != cells) { 
     3822            for (int i = 0; i < cells[CELL_ITEMID].length; i++) { 
     3823                visible.add(cells[CELL_ITEMID][i]); 
     3824            } 
    38213825        } 
    38223826 
  • src/com/vaadin/ui/TreeTable.java

    r2b7369f3 rc63f0db4  
    658658    public void setCollapsed(Object itemId, boolean collapsed) { 
    659659        if (isCollapsed(itemId) != collapsed) { 
    660             if (null == toggledItemId && getVisibleItemIds().contains(itemId) 
    661                     && !isRowCacheInvalidated()) { 
     660            if (null == toggledItemId && !isRowCacheInvalidated() 
     661                    && getVisibleItemIds().contains(itemId)) { 
    662662                // optimization: partial refresh if only one item is 
    663663                // collapsed/expanded 
Note: See TracChangeset for help on using the changeset viewer.