Announcement

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

    How to draw horizontal form

    How to draw an horizontal form like the one on the picture?
    thanks
    Attached Files

    #2
    You have to change the Orientation of the title of your formItems:
    Code:
    public static void testHorizontalForm(){
    		DynamicForm f = new DynamicForm();
    		f.setNumCols(5);
    		TextItem input1 = new TextItem();
    		input1.setTitle("Name");
    		input1.setTitleOrientation(TitleOrientation.TOP);		
    		TextItem input2 = new TextItem();
    		input2.setTitle("Address");
    		input2.setTitleOrientation(TitleOrientation.TOP);
    		TextItem input3 = new TextItem();
    		input3.setTitle("Phone");		
    		input3.setTitleOrientation(TitleOrientation.TOP);
    		TextItem input4 = new TextItem();
    		input4.setTitle("Email");		
    		input4.setTitleOrientation(TitleOrientation.TOP);
    		TextItem input5 = new TextItem();
    		input5.setTitle("Customer code");		
    		input5.setTitleOrientation(TitleOrientation.TOP);
    		ButtonItem btnTest = new ButtonItem();
    		btnTest.setTitle("TEST");
    		btnTest.setStartRow(true);
    		f.setItems(input1,input2,input3,input4,input5,btnTest);
    		RootPanel.get("container").add(f);
    	}
    Regards
    Alain

    Comment


      #3
      I believe you can set the TitleOrientation on the entire form and then only override it as you need on a field by field basis.

      The real trick to this though is increasing the number of columns in the form. I believe it defaults to 2 or 4 columns but that assumes your TitleOrientation is Left and titles take up a column as well.

      If you put the TitleOrientation to TOP and increase the number of form columns to 6 or so, you'd be able to accomplish what you are trying to do.

      Comment

      Working...
      X