Hybrid View

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    Austria
    Posts
    6
    Vote Rating
    0
    aus_gwit is on a distinguished road

      0  

    Default Answered: Dialog rendering issue

    Answered: Dialog rendering issue


    Hello!

    Im struggling with an rendering issue in a Dialog:
    I have the following (simple) piece of code
    Code:
    import com.google.gwt.user.client.Element;
    
    import com.extjs.gxt.ui.client.Style.Orientation;
    import com.extjs.gxt.ui.client.data.ModelData;
    import com.extjs.gxt.ui.client.util.Margins;
    import com.extjs.gxt.ui.client.widget.Dialog;
    import com.extjs.gxt.ui.client.widget.form.CheckBox;
    import com.extjs.gxt.ui.client.widget.layout.FitLayout;
    import com.extjs.gxt.ui.client.widget.layout.RowData;
    import com.extjs.gxt.ui.client.widget.layout.RowLayout;
    
    public class TerminAnkgdDialog extends Dialog {
    
      private ModelData termin;
      private LayoutContainerWidget mainContainer = null;
      private LayoutContainerWidget topContainer = null;
      private LayoutContainerWidget bottomContainer = null;
    
      @Override
      protected void onRender(Element parent, int pos) {
    
        super.onRender(parent, pos);
        this.setButtons("");
        this.setShadow(true);
        this.setModal(true);
        this.setWidth(480);
        this.setHeight(600);
        this.setLayout(new FitLayout());
    
        this.mainContainer = new LayoutContainer();
        // VBoxLayout vBoxLayout = new VBoxLayout();
        // vBoxLayout.setPadding(new Padding(5));
        // vBoxLayout.setVBoxLayoutAlign(VBoxLayoutAlign.STRETCH);
        this.mainContainer.setLayout(new RowLayout(Orientation.VERTICAL));
    
        this.topContainer = new LayoutContainer();
        this.topContainer.setBorders(true);
        this.bottomContainer = new LayoutContainer();
        this.bottomContainer.setBorders(true);
    
        this.mainContainer.add(this.topContainer, new RowData(-1, 0.8, new Margins(5)));
        this.mainContainer.add(this.bottomContainer, new RowData(-1, 0.2, new Margins(5)));
    
        this.add(this.mainContainer);
    
      }
    }
    It simply shows a Dialog with LayoutContainers with 80 % to 20 %.
    The problem is: It is only rendered correctly after the Dialog is being resized:
    Before resizing:
    before.jpg


    After resizing:
    after.PNG

    Does anyone know what am i doing wrong?
    Thank you very much

  2. Which version of GXT are you using? If you using GXT 2.2.3 or 2.2.4 you need to call layout(true) on the dialog after showing it. This is fixed in GXT 2.2.5

  3. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    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


    Which version of GXT are you using? If you using GXT 2.2.3 or 2.2.4 you need to call layout(true) on the dialog after showing it. This is fixed in GXT 2.2.5

  4. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    Austria
    Posts
    6
    Vote Rating
    0
    aus_gwit is on a distinguished road

      0  

    Default


    Thank You sven!

    I didn't noticed the release of 2.2.5.

Thread Participants: 1