Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Oct 2009
    Posts
    14
    Vote Rating
    0
    kospiotr is on a distinguished road

      0  

    Exclamation Viewport bug

    Viewport bug


    The following code:

    Code:
            Viewport viewport = new Viewport();
            viewport.add(new ContentPanel(), new MarginData(10));
            viewport.add(new Button("Button 1"));
            RootPanel.get().add(viewport);
    is failing with the message and stack:

    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)
    the source is taken from javadoc so I'm not sure what is wrong:
    out of date documentation or buggy code... or maybe I miss something.

    I use GXT 3.0 dp5

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    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();
          
        }
        
      }

  3. #3
    Sencha User
    Join Date
    Oct 2009
    Posts
    14
    Vote Rating
    0
    kospiotr is on a distinguished road

      0  

    Default


    Your code works fine. Keep it up guys, you're doing a great job!

  4. #4
    Sencha User
    Join Date
    Oct 2011
    Posts
    55
    Vote Rating
    0
    DarekKay is on a distinguished road

      0  

    Default 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:

    Code:
        public void onModuleLoad()
        {
            CustomViewport viewPort = new CustomViewport();
            viewPort.add(new TextArea());
            RootLayoutPanel.get().add(viewPort);
        }
    Type some text, then resize your browser window -> the text disappears.

  5. #5
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    This is a known issue with all cells and will be fixed in a future release.

  6. #6
    Sencha User
    Join Date
    Mar 2011
    Posts
    3
    Vote Rating
    0
    codingismy11to7 is on a distinguished road

      0  

    Default


    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:

    Code:
    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)
    ...
    Thanks