Hi Isomorphic. Quick question: how can I get a programmatic change to a FormItem's value trigger the DynamicForm's addItemChangedHandler?
As an example, this isn't working for me with one SelectItem:
I am using SmartGWT 6.0-p20160927.
Thanks
As an example, this isn't working for me with one SelectItem:
Code:
public class TestCases implements EntryPoint { private SelectItem selector; public void onModuleLoad() { DynamicForm form = new DynamicForm(); form.addItemChangedHandler(new ItemChangedHandler() { @Override public void onItemChanged(ItemChangedEvent event) { SC.say("Selected Items: " + selector.getValues().length); } }); selector = new SelectItem(); selector.setTitle("Select items"); selector.setMultiple(true); selector.setValueMap("Apples", "Oranges", "Bananas"); selector.addTitleClickHandler(new TitleClickHandler() { @Override public void onTitleClick(TitleClickEvent event) { if (selector.getValues().length != 0) { selector.setValues(); } else { selector.setValues("Apples", "Oranges", "Bananas"); } } }); form.setFields(selector); form.show(); } }
Thanks
Comment