Announcement

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

    StartRow(false) not working on Button or Submit Items

    setStartRow(Boolean.FALSE) does not appear to work for ButtonItem and SubmitItem.

    The method is available via Eclipse Content Assist, and is documented in Javadoc. So I'm expecting it to work like it does for SelectItem.

    Am I missing something?

    Demo code here:
    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.types.Alignment;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.ButtonItem;
    import com.smartgwt.client.widgets.form.fields.FormItem;
    import com.smartgwt.client.widgets.form.fields.SelectItem;
    import com.smartgwt.client.widgets.form.fields.SubmitItem;
    
    public class DemoSubmitItemStartRowFalse implements EntryPoint {
    
        @Override
        public void onModuleLoad() {
    
            DynamicForm dynamicForm = new DynamicForm() {
                {
                    setShowEdges(Boolean.TRUE);
                    setAlign(Alignment.CENTER);
                    setNumCols(4);
                    setCellBorder(1);
                }
            };
    
            dynamicForm.setFields(makeFormItems());
    
            dynamicForm.draw();
    
        }
    
        private FormItem[] makeFormItems() {
    
            FormItem[] formItems = new FormItem[] {
    
            makeSelectItem1(),
    
            makeSelectItem2(),
    
            makeButtonItem1(),
    
            makeButtonItem2(),
    
            makeSubmitItem1(),
    
            makeSubmitItem2()
    
            };
    
            return formItems;
        }
    
        private FormItem makeSelectItem1() {
    
            SelectItem selectItem1 = new SelectItem();
            selectItem1.setTitle("Select Item #1");
            selectItem1.setWrapTitle(Boolean.FALSE);
            selectItem1.setValueMap("One", "Two", "Three");
    
            return selectItem1;
        }
    
        private FormItem makeSelectItem2() {
    
            SelectItem selectItem2 = new SelectItem();
            selectItem2.setTitle("Select Item #2");
            selectItem2.setWrapTitle(Boolean.FALSE);
            selectItem2.setValueMap("Red", "Green", "Blue");
    
            // selectItem2.setStartRow(Boolean.TRUE);// This works as expected.
    
            return selectItem2;
        }
    
        private FormItem makeButtonItem1() {
    
            ButtonItem buttonItem1 = new ButtonItem();
            buttonItem1.setTitle("ButtonItem #1");
            buttonItem1.setColSpan(2);
    
            return buttonItem1;
        }
    
        private FormItem makeButtonItem2() {
    
            ButtonItem buttonItem2 = new ButtonItem();
            buttonItem2.setTitle("ButtonItem #2");
            buttonItem2.setColSpan(2);
    
            buttonItem2.setStartRow(Boolean.FALSE); // Does not work?
    
            return buttonItem2;
        }
    
        private FormItem makeSubmitItem1() {
    
            SubmitItem submitItem1 = new SubmitItem();
            submitItem1.setTitle("SubmitItem #1");
            submitItem1.setColSpan(2);
            submitItem1.setAlign(Alignment.CENTER);
    
            return submitItem1;
        }
    
        private FormItem makeSubmitItem2() {
    
            SubmitItem submitItem2 = new SubmitItem();
            submitItem2.setTitle("SubmitItem #2");
            submitItem2.setColSpan(2);
            submitItem2.setAlign(Alignment.CENTER);
    
            submitItem2.setStartRow(Boolean.FALSE); // Does not work?
    
            return submitItem2;
        }
    
    }
    -----------------------------------
    SmartClient Version: v9.1p_2016-06-25/PowerEdition Deployment (built 2016-06-25)
    GWT 2.5.1
    Chrome 51.0.2704.106 m

    #2
    ButtonItem also defaults to endRow:true. So what you are likely seeing is that startRow:false is functioning as expected, but endRow:true is still starting a new row *after* each button.

    Comment


      #3
      Ha! That was it. Never occurred to me to look for such a method. But there it is.

      It's times like this I wish the naming convention for methods was different, in order of descending peculiarity.

      E.g., if the methods were named...
      setRowStart()
      setRowEnd()

      ...instead of...

      setEndRow()
      setStartRow()

      I likely would have seen the "other" method.

      But then again, I have Eclipse Intelligent Code Completion enabled, for which "setRow" clearly shows...
      setRowSpan()
      setEndRow()
      setStartRow()

      ...and I still didn't see it.

      [head shake, sigh, palm to forehead]

      Thanks :)

      Comment

      Working...
      X