문제

I am new in SmartGWT and trying to select items of a SelectItem Widget programmatically. But didn't found a solution for that.

This is what I want:

enter image description here

This is my current code from the SmartGWT examples:

 SelectItem selectMultiple = new SelectItem();
      selectMultiple.setTitle("SelectItem: ");
      selectMultiple.setMultiple(true);
      selectMultiple.setMultipleAppearance(MultipleAppearance.PICKLIST);
      selectMultiple.setValueMap("Cat", "Dog", "Giraffe", "Goat", "Marmoset", "Mouse");

How can I select Items programmatically? Found nothing about that.

도움이 되었습니까?

해결책

Simply use SelectItem#setValues()

selectMultiple.setValues("Dog","Goat");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top