-
19 Oct 2011 1:44 PM #1
Viewport bug
Viewport bug
The following code:
is failing with the message and stack:Code:Viewport viewport = new Viewport(); viewport.add(new ContentPanel(), new MarginData(10)); viewport.add(new Button("Button 1")); RootPanel.get().add(viewport);
the source is taken from javadoc so I'm not sure what is wrong:00:15:59,469 [ERROR] Rebind result 'com.sencha.gxt.theme.base.client.container.ViewportBaseAppearance' has no default (zero argument) constructors.
java.lang.NoSuchMethodException: com.sencha.gxt.theme.base.client.container.ViewportBaseAppearance.<init>()
at java.lang.Class.getConstructor0(Class.java:2721)
at java.lang.Class.getDeclaredConstructor(Class.java:2002)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:463)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
at com.google.gwt.core.client.GWT.create(GWT.java:97)
at com.sencha.gxt.widget.core.client.container.Viewport.<init>(Viewport.java:47)
out of date documentation or buggy code... or maybe I miss something.
I use GXT 3.0 dp5
-
20 Oct 2011 4:32 PM #2
There is a bug in Viewport. The fix will go out in the next release. As a workaround, use this code:
Code:public class CustomViewport extends SimpleContainer { private boolean enableScroll; public CustomViewport() { monitorWindowResize = true; setEnableScroll(false); } @Override protected void onWindowResize(int width, int height) { setPixelSize(width, height); } public boolean getEnableScroll() { return enableScroll; } public void setEnableScroll(boolean enableScroll) { this.enableScroll = enableScroll; Window.enableScrolling(enableScroll); } @Override protected void onAttach() { setPixelSize(Window.getClientWidth(), Window.getClientHeight()); super.onAttach(); } }
-
20 Oct 2011 10:23 PM #3
Your code works fine. Keep it up guys, you're doing a great job!
-
21 Nov 2011 6:07 AM #4
TextArea - clearing text after resizing
TextArea - clearing text after resizing
Since I don't know, whether it's a CustomViewPort or ViewPort (or even TextArea) bug, I post it here:
Type some text, then resize your browser window -> the text disappears.Code:public void onModuleLoad() { CustomViewport viewPort = new CustomViewport(); viewPort.add(new TextArea()); RootLayoutPanel.get().add(viewPort); }
-
21 Nov 2011 6:14 AM #5
This is a known issue with all cells and will be fixed in a future release.
-
8 Jan 2012 11:19 PM #6
I ran into the cell resize clearing issue on the latest beta today. Is there any ETA on a fix, or any known workaround?
Oddly enough, if I select all the text and then resize by dragging (although not by clicking a collapse button), I get this exception:
ThanksCode:java.lang.NullPointerException: null at com.sencha.gxt.cell.core.client.form.FieldCell.checkViewData(FieldCell.java:253) at com.sencha.gxt.cell.core.client.form.TextAreaInputCell.render(TextAreaInputCell.java:74) at com.sencha.gxt.cell.core.client.form.TextAreaInputCell.render(TextAreaInputCell.java:1) at com.sencha.gxt.widget.core.client.cell.CellComponent.redraw(CellComponent.java:209) at com.sencha.gxt.widget.core.client.form.Field.redraw(Field.java:274) at com.sencha.gxt.widget.core.client.form.ValueBaseField.redraw(ValueBaseField.java:233) at com.sencha.gxt.widget.core.client.form.TextArea.redraw(TextArea.java:52) at com.sencha.gxt.widget.core.client.cell.CellComponent.onResize(CellComponent.java:312) at com.sencha.gxt.widget.core.client.Component.setPixelSize(Component.java:840) at com.sencha.gxt.widget.core.client.container.ResizeContainer.applyLayout(ResizeContainer.java:74) at com.sencha.gxt.widget.core.client.container.CardLayoutContainer.doLayout(CardLayoutContainer.java:89) at com.sencha.gxt.widget.core.client.container.ResizeContainer.forceLayout(ResizeContainer.java:46) at com.sencha.gxt.widget.core.client.container.ResizeContainer$1.execute(ResizeContainer.java:23) ...
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote