-
8 Feb 2012 10:41 AM #1
resizing of window with VerticalLayoutData doesn't occur until mouseover of window
resizing of window with VerticalLayoutData doesn't occur until mouseover of window
This has taking a while to reproduce, since it seems a variety of things must be in alignment. Under this scenario if you resize the browser window the table will NOT resize until the cursor goes over the window (delay resize until a mouse event occurs).Scenario where resizing is deferred until mouseover.VerticalLayoutData of 1, -1 is provided (so widget is controlled by container, height is that of widget)
Scenario where resizing works at time of resize (no mouseover needed).VerticalLayoutData of 1, 1 is provided (so width and height is controlled by container)Code:Viewport vp = new Viewport();VerticalLayoutContainer container = new VerticalLayoutContainer();vp.setWidget(container);container.add(this.asWidget(), new VerticalLayoutData(1, -1, new Margins(10)));RootPanel.get().add(vp);
Patch file is included to demonstrate behavior with your examples.Uses GroupingGridExample and also updates Explorer.gwt.xml modified to make GroupingGridExample the entry point.VerticalLayoutContainerAndMouseover.jpgCode:Viewport vp = new Viewport();VerticalLayoutContainer container = new VerticalLayoutContainer();vp.setWidget(container);container.add(this.asWidget(), new VerticalLayoutData(1, 1, new Margins(10)));RootPanel.get().add(vp);
Code:Index: src/main/java/com/sencha/gxt/explorer/Explorer.gwt.xml===================================================================--- src/main/java/com/sencha/gxt/explorer/Explorer.gwt.xml (revision 2134)+++ src/main/java/com/sencha/gxt/explorer/Explorer.gwt.xml (working copy)@@ -12,7 +12,7 @@ - + @@ -31,5 +31,6 @@ - + + Index: src/main/java/com/sencha/gxt/explorer/client/grid/GroupingGridExample.java===================================================================--- src/main/java/com/sencha/gxt/explorer/client/grid/GroupingGridExample.java (revision 2134)+++ src/main/java/com/sencha/gxt/explorer/client/grid/GroupingGridExample.java (working copy)@@ -14,6 +14,7 @@ import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; import com.sencha.gxt.core.client.ValueProvider;+import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.data.shared.ListStore; import com.sencha.gxt.data.shared.ModelKeyProvider; import com.sencha.gxt.data.shared.PropertyAccess;@@ -21,12 +22,15 @@ import com.sencha.gxt.examples.resources.client.model.Stock; import com.sencha.gxt.explorer.client.model.Example.Detail; import com.sencha.gxt.widget.core.client.ContentPanel;+import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;+import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;+import com.sencha.gxt.widget.core.client.container.Viewport; import com.sencha.gxt.widget.core.client.grid.ColumnConfig; import com.sencha.gxt.widget.core.client.grid.ColumnModel; import com.sencha.gxt.widget.core.client.grid.Grid; import com.sencha.gxt.widget.core.client.grid.GroupingView; -@Detail(name = "Grouping Grid", icon = "grouping", category = "Grid", classes = {Stock.class})+@Detail(name = "Grouping Grid", icon = "grouping", category = "Grid", classes = {Stock.class}, fit=true) public class GroupingGridExample implements EntryPoint, IsWidget { interface StockProperties extends PropertyAccess {@@ -75,7 +79,7 @@ final GroupingView view = new GroupingView(); view.setShowGroupedColumn(false);- view.setForceFit(true);+ //view.setForceFit(true); Grid grid = new Grid(store, cm); grid.setView(view);@@ -97,7 +101,15 @@ @Override public void onModuleLoad() {- RootPanel.get().add(this);+ Viewport vp = new Viewport();+ VerticalLayoutContainer container = new VerticalLayoutContainer();+ vp.setWidget(container);+ + container.add(this.asWidget(), new VerticalLayoutData(1, -1, new Margins(10)));+ //Resizing works if height is set to -1 so it expands to the entire window.+ //container.add(this.asWidget(), new VerticalLayoutData(1, 1, new Margins(10)));+ + RootPanel.get().add(vp); } }
-
8 Feb 2012 12:42 PM #2
In looking at VerticalLayoutContainer.doLayout, I can see why there is a difference now due to the height value. If the height == -1, it does this "scheduleEntry" and returns.
Fix #1, remove 'return statement from the shown code. I doubt this is the correct solution, but my child widget does get resized as expected.
Fix #2, change scheduleEntry to scheduleDeffered. Again, not sure that is the "correct" fix.
Code:if (height > 1) { ph -= height; } else if (height == -1) { if ((c instanceof HasWidgets || c instanceof IndexedPanel) && !secondPassRequired) { secondPassRequired = true; Scheduler.get().scheduleEntry(forceLayoutCommand); return; }
Please let me know if either solution is acceptable, I would like to fix our code until the next beta is released (and hopefully with a fix for this).
Thanks.
-
8 Feb 2012 2:55 PM #3
Can you please provide the code in a formated way? There are no newlines in there or anything.
This is probably an already known issue which is already on the list, just to be sure.
-
8 Feb 2012 3:51 PM #4
I created the post the same was as my previous post, but this time I did "preview post" before submitting. It seems that preview post messes up newlines when you post from that. When I am back in the office, I will resubmit the patch.
Someone should look into the forum software to see why a post after preview causes the newlines to go away (at least that is what happened for me here).
-
9 Feb 2012 2:32 AM #5
That would be great. Thank you.
-
9 Feb 2012 5:10 AM #6
Resubmitted patch, thanks.
Code:Index: com.sencha.gxt.examples/src/main/java/com/sencha/gxt/explorer/Explorer.gwt.xml =================================================================== --- com.sencha.gxt.examples/src/main/java/com/sencha/gxt/explorer/Explorer.gwt.xml (revision 2134) +++ com.sencha.gxt.examples/src/main/java/com/sencha/gxt/explorer/Explorer.gwt.xml (working copy) @@ -12,7 +12,7 @@ <!-- <set-property name="gxt.logging.enabled" value="true" /> --> - <inherits name="com.sencha.gwt.uibinder.UiBinder" /> + <!-- <inherits name="com.sencha.gwt.uibinder.UiBinder" /> --> <!-- Specify the paths for translatable code --> <source path='client' /> @@ -31,5 +31,6 @@ <set-configuration-property name="GXT.state.autoBeanFactory" value="com.sencha.gxt.explorer.client.misc.WindowStateExample.ExampleAutoBeanFactory" /> - <entry-point class='com.sencha.gxt.explorer.client.Explorer' /> + <!-- <entry-point class='com.sencha.gxt.explorer.client.Explorer' /> --> + <entry-point class='com.sencha.gxt.explorer.client.grid.GroupingGridExample'/> </module> Index: com.sencha.gxt.examples/src/main/java/com/sencha/gxt/explorer/client/grid/GroupingGridExample.java =================================================================== --- com.sencha.gxt.examples/src/main/java/com/sencha/gxt/explorer/client/grid/GroupingGridExample.java (revision 2134) +++ com.sencha.gxt.examples/src/main/java/com/sencha/gxt/explorer/client/grid/GroupingGridExample.java (working copy) @@ -14,6 +14,7 @@ import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; import com.sencha.gxt.core.client.ValueProvider; +import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.data.shared.ListStore; import com.sencha.gxt.data.shared.ModelKeyProvider; import com.sencha.gxt.data.shared.PropertyAccess; @@ -21,12 +22,15 @@ import com.sencha.gxt.examples.resources.client.model.Stock; import com.sencha.gxt.explorer.client.model.Example.Detail; import com.sencha.gxt.widget.core.client.ContentPanel; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; +import com.sencha.gxt.widget.core.client.container.Viewport; import com.sencha.gxt.widget.core.client.grid.ColumnConfig; import com.sencha.gxt.widget.core.client.grid.ColumnModel; import com.sencha.gxt.widget.core.client.grid.Grid; import com.sencha.gxt.widget.core.client.grid.GroupingView; -@Detail(name = "Grouping Grid", icon = "grouping", category = "Grid", classes = {Stock.class}) +@Detail(name = "Grouping Grid", icon = "grouping", category = "Grid", classes = {Stock.class}, fit=true) public class GroupingGridExample implements EntryPoint, IsWidget { interface StockProperties extends PropertyAccess<Stock> { @@ -75,7 +79,7 @@ final GroupingView<Stock> view = new GroupingView<Stock>(); view.setShowGroupedColumn(false); - view.setForceFit(true); + //view.setForceFit(true); Grid<Stock> grid = new Grid<Stock>(store, cm); grid.setView(view); @@ -97,7 +101,15 @@ @Override public void onModuleLoad() { - RootPanel.get().add(this); + Viewport vp = new Viewport(); + VerticalLayoutContainer container = new VerticalLayoutContainer(); + vp.setWidget(container); + + container.add(this.asWidget(), new VerticalLayoutData(1, -1, new Margins(10))); + //Resizing works if height is set to 1 so it expands to the entire window. + //container.add(this.asWidget(), new VerticalLayoutData(1, 1, new Margins(10))); + + RootPanel.get().add(vp); } }
-
10 Feb 2012 8:47 AM #7
Now I have another scenario (that I am yet to get working in your explorer code), but the grid (which is nested quite well) will not resize at all.
Now if I change the code to remove the return and schedule deferred it does get rendered correct, but debugging shows this class never ends (which makes sense since the scheduled defer will go indefinately). In any case, something is going on to prevent the desired re-rendering.
if ((c instanceof HasWidgets || c instanceof IndexedPanel) && !secondPassRequired) {
secondPassRequired = true;
Scheduler.get().scheduleDeferred(forceLayoutCommand);
///return;
}
I will try to work on an example and add it to this defect. However, if you make any progress the initial issue on this, I would appreciate the change so I verify to see if it would by chance fix this issue.
Thanks.
-
10 Feb 2012 8:53 AM #8
There is no need to use the explorer for examples. Easiest is to just create a standalone one. THan you also do not need to provide patch files but can provide the hole class required. This is way more efficient.(that I am yet to get working in your explorer code)
-
5 Oct 2012 11:37 AM #9
Here is a stand alone example of this, since it seems this issue was lost over the issues of trying to apply this to the demo pages vs. creating a stand-alone test case.
resize the browser and the table/content panel do not resize until there is a mouse over...
ResizingIssue.zip
-
1 Nov 2012 3:56 PM #10
I may be missing something here, but it the ContentPanel/Grid don't resize no matter what I do, which seems to make sense, as they are given explicit sizes.
Removing these lines causes an issue, predictably, as the ContentPanel was added to the inner VLC with size -1,-1, meaning "don't size this child, it will decide its own size". Additionally, the FieldSet is added to the outer VLC with the same sizing, so the outer VLC isn't sizing the FieldSet, which therefore has no size to give the inner VLC. Even if it did, the inner VLC has also been instructed not to size its child (panel).Code:grid.setHeight(300); grid.setWidth(800); panel.setWidth(800); panel.setHeight(200);
Edit: Just got this issue to occur in IE8, though still cant get it in FF or Chrome. I'm actually not sure why it is resizing at all, as it has been given -1 as a width/height and an explicit height/width, so it shouldn't be passing the layout along at all. That said, I'm still not sure the structure makes sense, especially if the bug is that the Grid/ContentPanel is *not* resizing. Can you clarify what you expect this to do?
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote