Announcement

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

    Reset scroll position for child content reflow

    Hi ,

    I have a VLayout component , with many grids , forms embedded into it. Hence it shows up with a scroll bar , which is fine.

    This layout has a button which opens a new GWT window .

    When i open this window the scroll position on the original layout is lost. For example if at the time of opening the window the scroll top was 300 , it is reset to 0.

    When i close the window, i.e. window.clear() , the scroll on the layout does not return back to the original position to 300 but stays at 0.

    This gives a very bad user experience.

    On inspecting the event handler log , i can see the following:

    I am using SwmartGWT3.0 power edition.

    Code:
    16:57:50.515:RDQ0:DEBUG:scrolling:isc_VLayout_14:scrollTo(undefined, 0), reason: Reset scroll position for child content reflow
    16:57:51.109:RDQ0:INFO:scrolling:isc_InsiderSearchWindow_12_1_body:Drawn size: 1134 by 186, specified: 1134 by 186, scrollbar state: 
    16:57:51.124:TMR1:DEBUG:EventHandler:mousing out of [HLayout ID:isc_HLayout_40]  mousing over [Button ID:isc_Button_57]
    16:57:53.406:MDN2:INFO:EventHandler:Target Canvas for event 'mousedown': [Button ID:isc_Button_57]
    16:57:53.406:MDN2:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[Button ID:isc_Button_57]' has handler: Canvas.prepareForDragging()
    16:57:53.421:MDN2:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[HLayout ID:isc_HLayout_40]' has handler: Canvas.prepareForDragging()
    16:57:53.421:MDN2:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[VLayout ID:isc_VLayout_102]' has handler: Canvas.prepareForDragging()
    16:57:53.421:MDN2:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[VLayout ID:isc_VLayout_100]' has handler: Canvas.prepareForDragging()
    16:57:53.437:MDN2:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[Layout ID:isc_InsiderSearchWindow_1_body]' has handler: Canvas.prepareForDragging()
    16:57:53.437:MDN2:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[Window ID:isc_InsiderSearchWindow_1]' has handler: Canvas.prepareForDragging()
    16:57:53.437:MDN2:DEBUG:EventHandler:Event 'prepareForDragging' bubbled to top
    16:57:53.453:MDN2:DEBUG:EventHandler:Event 'mouseDown' bubbled to top
    16:57:53.453:selectionchange3:INFO:EventHandler:Target Canvas for event 'selectionchange': [DynamicForm ID:isc_DynamicForm_58]
    16:57:53.468:selectionchange3:DEBUG:EventHandler:Event 'selectionChange' bubbled to top
    16:57:53.499:selectionchange3:DEBUG:EventHandler:Event 'mouseStillDown' bubbled to top
    16:57:53.734:MUP6:INFO:EventHandler:Target Canvas for event 'mouseup': [Button ID:isc_Button_57]
    16:57:53.749:MUP6:DEBUG:EventHandler:Event 'mouseUp' bubbled to top
    16:57:53.765:MUP6:DEBUG:EventHandler:Event 'click' bubbled to top
    16:57:54.499:SCR9:DEBUG:scrolling:isc_VLayout_14:scrollTo(0, 264), reason: nativeScroll
    16:57:54.687:WARN:RPCManager:Multiple RPCRequests with params attribute in one transaction - merging
    16:57:54.890:TMR2:DEBUG:EventHandler:mousing over [ScreenSpan ID:isc_EH_screenSpan]
    16:57:54.937:RDQ5:DEBUG:scrolling:isc_VLayout_14:scrollTo(undefined, 0), reason: Reset scroll position for child content reflow
    16:57:55.218:XRP0:WARN:RPCManager:Multiple RPCRequests with params attribute in one transaction - merging
    16:57:55.421:RDQ3:INFO:scrolling:isc_InsiderListGridPanel_11_0_body:Drawn size: 834 by 126, specified: 834 by 126, scrollbar state: 
    16:57:55.656:SCR0:DEBUG:scrolling:isc_VLayout_14:scrollTo(0, 264), reason: nativeScroll
    16:57:56.093:RDQ5:INFO:scrolling:isc_InsiderListGridPanel_11_0_body:Drawn size: 834 by 126, specified: 834 by 126, scrollbar state: 
    16:57:56.187:RDQ8:DEBUG:scrolling:isc_VLayout_14:scrollTo(undefined, 0), reason: Reset scroll position for child content reflow

    Thanks.
    Ravi.

    #2
    We have made a change to the 3.1 and 4.0 branches which is likely to resolve this issue.
    Please try the next nightly build and let us know if the problem persists for you.

    If you do continue to see it and would like us to investigate, please post a runnable test case so we can reproduce it on our end

    Thanks
    Isomorphic Software

    Comment


      #3
      Thanks Isomorphic.

      Comment


        #4
        The problem still exists. Here is a TestCase for reproducing the behaviour:

        Code:
        public void onModuleLoad() {
        	RootPanel.get("loadingWrapper").getElement().removeFromParent();
        
        	SectionStack stack = new SectionStack();
        	stack.setVisibilityMode(VisibilityMode.MULTIPLE);
        	stack.setOverflow(Overflow.VISIBLE);
        	stack.setCanResizeSections(false);
        
        	stack.addSection(createSection(new HLayout(), 500));
        
        	stack.addSection(getTestTree());
        
        	stack.addSection(createSection(new HLayout(), 500));
        
        	HLayout layout = new HLayout();
        	layout.setOverflow(Overflow.AUTO);
        	layout.setWidth100();
        	layout.setHeight100();
        	layout.addMember(stack);
        	layout.draw();
        }
        
        private SectionStackSection createSection(Canvas canvas, int height) {
        	SectionStackSection section = new SectionStackSection();
        	canvas.setHeight(height);
        	section.setExpanded(true);
        	section.addItem(canvas);
        	return section;
        }
        
        private SectionStackSection getTestTree() {
        	final ExtendedDynamicForm productSelectorForm = new ExtendedDynamicForm();
        	TreeGrid grid = new TreeGrid();
        	grid.setHeight(500);
        	final Tree tree = new Tree();
        	grid.setData(tree);
        	grid.setHilites(new Hilite[]{
        			new Hilite() {
        				{
        					setId("foo");
        					setTextColor("#555555");
        					setCssText("font-style: italic;");
        				}
        			}
        	});
        	ButtonItem buttonManualProduct = new ButtonItem("add");
        	buttonManualProduct.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
        		@Override
        		public void onClick(ClickEvent clickEvent) {
        			tree.add(new TreeNode(), tree.getRoot());
        			tree.openAll();
        		}
        	});
        	productSelectorForm.setFields(buttonManualProduct);
        
        	SectionStackSection section = new SectionStackSection();
        	section.addItem(productSelectorForm);
        	section.addItem(grid);
        	section.setExpanded(true);
        	return section;
        }
        Scroll to the middle and push the button. Now the pane is scrolled to the top position.

        If you remove the hilites of the grid, the scrollPosition doesn't change.
        Last edited by andy.2003; 10 Nov 2012, 07:07. Reason: added additional information

        Comment


          #5
          Thanks for the test case. We have made some new changes which should address this
          Please try the next nightly build (Dated Nov 13 or greater)

          Regards
          Isomorphic Software

          Comment


            #6
            Hi Isomorphic,

            Is there a release date when this fix will be oficially released ?

            We wont be allowed to use the nightly build version for the release of our application.

            Thanks
            Ravi.

            Comment


              #7
              We'd recommend using today's 3.1d build. It's what's being deployed as the 3.1 release this over the next two days.

              Comment


                #8
                Hi Isomorphic ,

                Is there a patch fix for this we can apply to 3.0 to fix this issue.

                We dont have the time now to upgrade to 3.1 and delay our release.

                Thanks,
                Ravi.

                Comment


                  #9
                  Sorry, this isn't something that can reasonably be applied as a "patch" to an older version.

                  You should either update to 3.1 or attempt an app-level workaround, such as a manual call to scrollTo() delayed via DeferredCommand / Scheduler.

                  Comment


                    #10
                    Hi Isomorphic,

                    Thanks for your reply.

                    The approach of scroll to or deferred command dosent help. I am trying a app level work around.

                    Thanks,
                    Ravi.

                    Comment

                    Working...
                    X