Changeset 19205 in svn


Ignore:
Timestamp:
06/03/11 06:47:11 (2 years ago)
Author:
jonatan.kronqvist@…
Message:

Fix for #7027 and #7029 - treetable no longer scrolls on keyboard collapse/expand and doesn't lose focus on expand

Location:
addons/TreeTable/src/com/vaadin/addon/treetable/client/ui
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • addons/TreeTable/src/com/vaadin/addon/treetable/client/ui/VTreeTable.java

    r19158 r19205  
    1111import com.google.gwt.user.client.Event; 
    1212import com.google.gwt.user.client.ui.Widget; 
     13import com.vaadin.addon.treetable.client.ui.VPatchedScrollTable.VScrollTableBody.VScrollTableRow; 
    1314import com.vaadin.addon.treetable.client.ui.VTreeTable.VTreeTableScrollBody.VTreeTableRow; 
    1415import com.vaadin.terminal.gwt.client.ApplicationConnection; 
     
    1617import com.vaadin.terminal.gwt.client.UIDL; 
    1718import com.vaadin.terminal.gwt.client.ui.FocusableScrollPanel; 
    18 import com.vaadin.terminal.gwt.client.ui.VScrollTable; 
    19  
    20 public class VTreeTable extends VScrollTable { 
     19 
     20public class VTreeTable extends VPatchedScrollTable { 
    2121 
    2222    public static final String ATTRIBUTE_HIERARCHY_COLUMN_INDEX = "hci"; 
     
    2424    private boolean selectionPending; 
    2525    private int colIndexOfHierarchy; 
     26    private String collapsedRowKey; 
    2627 
    2728    @Override 
     
    3839        super.updateFromUIDL(uidl, client); 
    3940        if (collapseRequest) { 
     41            if (collapsedRowKey != null && scrollBody != null) { 
     42                VScrollTableRow row = getRenderedRowByKey(collapsedRowKey); 
     43                if (row != null) { 
     44                    setRowFocus(row); 
     45                    focus(); 
     46                } 
     47            } 
     48 
    4049            int scrollPosition2 = widget.getScrollPosition(); 
    4150            if (scrollPosition != scrollPosition2) { 
     
    5059            // TODO figure out if the row needs to focused at all 
    5160 
    52             // scrolled to parent by the server, focusedRow is probably the same 
     61            // scrolled to parent by the server, focusedRow is probably the sam 
    5362            // as the first row in view port 
    54  
    5563        } 
    5664    } 
     
    6169    } 
    6270 
    63     class VTreeTableScrollBody extends 
    64             com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody { 
     71    class VTreeTableScrollBody extends VPatchedScrollTable.VScrollTableBody { 
    6572        private int identWidth = -1; 
    6673 
     
    7582 
    7683        class VTreeTableRow extends 
    77                 VScrollTable.VScrollTableBody.VScrollTableRow { 
     84                VPatchedScrollTable.VScrollTableBody.VScrollTableRow { 
    7885 
    7986            private boolean isTreeCellAdded = false; 
     
    299306 
    300307    private void sendToggleCollapsedUpdate(String rowKey) { 
     308        collapsedRowKey = rowKey; 
    301309        collapseRequest = true; 
    302310        client.updateVariable(paintableId, "toggleCollapsed", rowKey, true); 
Note: See TracChangeset for help on using the changeset viewer.