Announcement

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

    ComboBoxItem Width problems

    Smartgwt 2.4 under Firefox:

    Iwant to use a ComboBoxItem BUT I get Two problem and one question:
    1°) I didn't find any way of changing the Title width and so I get Variable Data on one line and source on another one.
    2°) When I uncomment the line setting the width of the Combo (FormItem.setWidth) I get an error:
    Uncaught JavaScript exception [_4.body is undefined] in http://localhost:8080/plastico/plastico/sc/modules/ISC_Forms.js, line 1897

    3°) Is there somewhere details about the FormItem Type (here setType("comboBox")?

    Thanks
    Alain
    Code:
    TestWidget test = new TestWidget();
    RootPanel.get().add(test);
    
    public class TestWidget extends VLayout{
      public TestWidget(){
    	DynamicForm form = new DynamicForm();
    	ComboBoxItem sourcesList = new ComboBoxItem();
    	sourcesList.setType("comboBox");  
    	this.setWidth(800);
    	this.setHeight(600);
    	form.setNumCols(2);
    	form.setWidth("100%");
    	sourcesList.setWidth("450px");
    	sourcesList.setTitle("Variable data source");
    	LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();  
    	valueMap.put("CNAV", "CNAV");  
    	valueMap.put("CNAM", "DCIR-CNAMTS");  
    	sourcesList.setValueMap(valueMap);
    	form.setFields(sourcesList);
    	this.addMember(form);
     }
    }

    #2
    Do not setType("comboBox") that's redundant with creating a ComboBoxItem.

    Do not pass a string with "px" to setWidth(). Pass an integer pixel value, and use Strings only for percents.

    DynamicForm has a wrapItemTitles attribute for controlling wrapping of titles.

    Comment


      #3
      Ok I get it (so many attributes..)
      Many thanks for the fast reply

      Regards

      Alain

      Comment

      Working...
      X