Pergunta

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.

Foi útil?

Solução

Simply use SelectItem#setValues()

selectMultiple.setValues("Dog","Goat");
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top