Threaded View

    Success! Looks like we've fixed this one. According to our records the fix was applied for a bug in our system in a recent build.
  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    21
    Vote Rating
    0
    robferguson is on a distinguished road

      0  

    Default FieldSet layout (re-size) bug

    FieldSet layout (re-size) bug


    Hi,

    Following on from this post:

    http://www.sencha.com/forum/showthre...nd-row-spacers

    I have a form that occupies the center panel of a BorderLayoutContainer. The form will size / re-size correctly without Ext GWT FieldSet's. However, once I add the Ext GWT FieldSet's to the form it no longer resize's correctly.

    However, it works as expected when using "<filedset>":

    Code:
      private native String getAddressInformationSectionTableMarkup() /*-{
        return [ '<fieldset>',
            '<legend>Address Information:</legend>',
            '<table width=100% cellpadding=0 cellspacing=0>',
            '<tr><td class=addressName width=50%></td><td class=postalCode width=50%></td></tr>',
            '<tr><td class=addressLine1></td><td class=country></td></tr>',
            '<tr><td class=addressLine2></td><td class=addressType></td></tr>',
            '<tr><td class=addressLine3></td><td></td></tr>',
            '<tr><td class=city></td><td></td></tr>',
            '<tr><td class=state></td><td></td></tr>',
            '</table>',
            '</fieldset>'
        ].join("");
      }-*/;
    Cheers
    Rob

    Code:
    public class ContactInformationView extends AbstractFormView<ContactInformationUiHandlers> implements
        ContactInformationPresenter.MyView {
    
      protected TabPanel tabPanel;
    
      protected VerticalLayoutContainer vLayout;
    
      protected FieldSet generalInformation;
      protected FieldSet addressInformation;
    
      protected HtmlLayoutContainer generalLayout;
      protected HtmlLayoutContainer addressLayout;
    
      @Inject
      public ContactInformationView(final EventBus eventBus, final TabPanel tabPanel) {
        super(eventBus);
    
        Log.debug("ContactInformationView()");
    
        this.tabPanel = tabPanel;
    
        getTabPanel().setWidth(CONTEXT_AREA_WIDTH);
        getForm().setWidget(getTabPanel());
    
        createGeneralInformationSection();
    
        createAddressInformationSection();
    
        vLayout = new VerticalLayoutContainer();
        vLayout.setLayoutData(new MarginData(DEFAULT_MARGIN));
    
        // vLayout.add(generalInformation, new VerticalLayoutData(1, -1));
        // vLayout.add(addressInformation, new VerticalLayoutData(1, -1));
    
        vLayout.add(generalLayout, new VerticalLayoutData(1, -1));
        vLayout.add(addressLayout, new VerticalLayoutData(1, -1));
    
        getTabPanel().add(vLayout, "General");
    
        // /*
    
        this.panel.addResizeHandler(new ResizeHandler() {
          @Override
          public void onResize(ResizeEvent event) {
    
            int width = event.getWidth();
            int height = event.getHeight();
    
            Log.debug("vLayout - width: " + width + " height: " + height);
    
            vLayout.setSize(width + "px", height + "px");
            // generalInformation.setWidth((width - DEFAULT_MARGIN * 5) + "px");
            // addressInformation.setWidth((width - DEFAULT_MARGIN * 5) + "px");
            // generalInformation.forceLayout();
            // addressInformation.forceLayout();
          }
        });
    
        // */
      }
    
      protected void createGeneralInformationSection() {
    
        generalInformation = new FieldSet();
        generalInformation.setHeadingText("General Information");
        generalInformation.setCollapsible(true);
    
        generalLayout = new HtmlLayoutContainer(getGeneralInformationSectionTableMarkup());
        generalLayout.setLayoutData(new MarginData(DEFAULT_MARGIN));
    
        new ContactInformationNameSection(generalLayout);
        new ContactInformationElectronicAddressSection(generalLayout);
    
        // generalInformation.add(generalLayout);
      }
    
      protected void createAddressInformationSection() {
    
        addressInformation = new FieldSet();
        addressInformation.setHeadingText("Address Information");
        addressInformation.setCollapsible(true);
    
        addressLayout = new HtmlLayoutContainer(getAddressInformationSectionTableMarkup());
        addressLayout.setLayoutData(new MarginData(DEFAULT_MARGIN));
    
        new ContactInformationAddressSection(addressLayout);
    
        // addressInformation.add(addressLayout);
      }
    
      private native String getGeneralInformationSectionTableMarkup() /*-{
        return [ '<table width=100% cellpadding=0 cellspacing=0>',
            '<tr><td class=salutation width=50%></td><td class=businessPhone width=50%></td></tr>',
            '<tr><td class=givenName></td><td class=homePhone></td></tr>',
            '<tr><td class=middleName></td><td class=mobilePhone></td></tr>',
            '<tr><td class=familyName></td><td class=fax></td></tr>', '</table>'
        ].join("");
      }-*/;
    
      private native String getAddressInformationSectionTableMarkup() /*-{
        return [ '<fieldset>',
            '<legend>Address Information:</legend>',
            '<table width=100% cellpadding=0 cellspacing=0>',
            '<tr><td class=addressName width=50%></td><td class=postalCode width=50%></td></tr>',
            '<tr><td class=addressLine1></td><td class=country></td></tr>',
            '<tr><td class=addressLine2></td><td class=addressType></td></tr>',
            '<tr><td class=addressLine3></td><td></td></tr>',
            '<tr><td class=city></td><td></td></tr>',
            '<tr><td class=state></td><td></td></tr>',
            '</table>',
            '</fieldset>'
        ].join("");
      }-*/;
    Attached Images