Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Mouse wheel scrolling behaviour on nested form in a ListGrid expansion component

    SmartClient Version: v9.1p_2016-04-09/Pro Deployment (built 2016-04-09)
    Tried on Chrome Version 49.0.2623.110 m & Firefox 26.0

    I have an issue scrolling a TextAreaItem that appears in an expansion component of a ListGrid record. When the grid contains a single record (and therefore the grid has no scrollbar) the mouse wheel scrolling affects the nested TextAreaItem (as I am expecting). However with many rows in the grid (my example has 500) I cannot make the mouse wheel scroll the TextAreaItem within the list grid row. It always scrolls the ListGrid results set instead. I have tried multiple ways of trying to shift the focus to the TextAreaItem to scroll this component, rather than scrolling the ListGrid, to no avail.

    Is there a solution to this, or will the mouse wheel always scroll the ListGrid if it has a scrollbar, regardless of where I set the focus in the nested expansion component?

    Code:
    import java.util.ArrayList;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.Canvas;
    import com.smartgwt.client.widgets.events.MouseOverEvent;
    import com.smartgwt.client.widgets.events.MouseOverHandler;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.TextAreaItem;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.grid.ListGridRecord;
    import com.smartgwt.client.widgets.layout.VLayout;
    import com.smartgwt.client.widgets.tab.Tab;
    import com.smartgwt.client.widgets.tab.TabSet;
    
    /**
     * Title:        Test<br>
     * Description:  Sandbox for testing stuff<br>
     */
    public class Test implements EntryPoint {
        
        /**
         * {@inheritDoc}
         */
        @Override
        public void onModuleLoad() {
            SC.showConsole();
            final ListGrid grid = new ListGrid() {
                
                @Override
                protected Canvas getExpansionComponent( ListGridRecord record ) {
    
                    TabSet tabSet = new TabSet();
                    tabSet.setHeight( 300 );
                    tabSet.setWidth100();
    
                    Tab tab = new Tab("A tab");
    
                    // If this widget has a scrollbar, I want the mousewheel movement to scroll this widget, not the ListGrid
                    TextAreaItem textArea = new TextAreaItem("focusOfScrolling", "Desired Scroll Focus");
                    textArea.setHeight(200);
                    textArea.setWidth("*");
                    textArea.setValue( VERY_LONG_STRING );
    
                    final DynamicForm form = new DynamicForm();
                    form.setFields( textArea );
                    form.addMouseOverHandler( new MouseOverHandler() {
    
                        @Override
                        public void onMouseOver( MouseOverEvent event ) {
                            form.focus(); 
                        }
                    });
                    tab.setPane(form);
                    tabSet.setTabs( tab );
    
                    VLayout layout = new VLayout();
                    layout.setWidth100();
                    layout.setHeight100();
                    layout.addMember( tabSet );
    
                    return layout;
                }
            };
    
            grid.setCanExpandRecords( true );
            grid.setCanExpandMultipleRecords( true );
            grid.setFields( new ListGridField("a") );
            
            ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>();
            for ( int i=0; i<500; i++) {
                ListGridRecord record = new ListGridRecord();
                record.setAttribute("a", "something");
                records.add( record );
            }
            
            grid.setData( records.toArray( new ListGridRecord[records.size()]) );
            
            grid.setWidth100();
            grid.setHeight100();
            
            Canvas layout = new Canvas();
            layout.setWidth100();
            layout.setHeight100();
            layout.addChild(grid);
            layout.show();
        }
        
        private static final String VERY_LONG_STRING =
            "long string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string long string long string long string long "
            + "string long string long string long string long string long string long string long string ";
    }

    #2
    Just a quick follow up to let you know we do see this issue and are looking into it.
    We'll follow up when we have more information for you.

    Regards
    Isomorphic Software

    Comment


      #3
      We've now made a framework change which should address this issue and ported back to the 4.1 branch.
      Please try the next nightly build, dated April 21 or above.

      Regards
      Isomorphic Software

      Comment


        #4
        Hi, verified this working in 2016-04-28 nightly.

        Thankyou!

        Comment

        Working...
        X