Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    tab controls

    Hello,

    Using Smart GWT 3.1p and GWT 2.5.1

    How do I set the controls for a tab so that the controls (buttons) are side by side. So far I can only get them vertically stacked which is not what I wanted.

    Below is what I tried,
    Thanks,
    Evan

    private void addCustomControls() {
    ButtonItem bPrint = new ButtonItem("Print");
    ClickHandler clickHandlerPrint = new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
    SC.say("TODO handle Print");
    }

    };
    bPrint.addClickHandler(clickHandlerPrint);

    ButtonItem bPDF = new ButtonItem("PDF");
    ClickHandler clickHandlerPDF = new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
    SC.say("TODO handle PDF");
    }

    };
    bPDF.addClickHandler(clickHandlerPDF);

    DynamicForm form = new DynamicForm();
    form.setPadding(0);
    form.setMargin(0);
    form.setCellPadding(3);
    form.setNumCols(1);
    form.setFields(bPrint, bPDF);
    this.setTabBarControls(TabBarControls.TAB_SCROLLER, TabBarControls.TAB_PICKER, form);
    }

    #2
    Don't setNumCols(1) on the form and *do* setEndRow(false) on the buttons

    Comment


      #3
      Hello

      Made the changes, but still have the problem.

      Below is the code.
      Attached is a screen shot of the controls on the tab. The controls are correctly on the far right to the tabs (way off to the left). But the controls (buttons) are stacked vertically, and I want them horizontal side by side.

      Thanks,
      Evan

      private void addCustomControls() {
      ButtonItem bPrint = new ButtonItem("Print");
      ClickHandler clickHandlerPrint = new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
      SC.say("TODO handle Print");
      }

      };
      bPrint.addClickHandler(clickHandlerPrint);
      bPrint.setEndRow(false);

      ButtonItem bPDF = new ButtonItem("PDF");
      ClickHandler clickHandlerPDF = new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
      SC.say("TODO handle PDF");
      }

      };
      bPDF.addClickHandler(clickHandlerPDF);
      bPDF.setEndRow(false);

      DynamicForm form = new DynamicForm();
      form.setPadding(0);
      form.setMargin(0);
      form.setCellPadding(3);
      form.setFields(bPrint, bPDF);
      this.setTabBarControls(TabBarControls.TAB_SCROLLER, TabBarControls.TAB_PICKER, form);
      }
      Attached Files

      Comment


        #4
        setStartRow(false) also - this behavior and both of these attributes are covered in the docs

        Comment

        Working...
        X