IWEventRegistry.addFormHandler("onFormInit", init); function init() { IWEventRegistry.addItemHandler("/Root/List", "onItemChange", clearList);} function clearList(item){alert("Set to 5");IWDatacapture.getItem("/Root/List").setValue(5);alert("Set to 2");IWDatacapture.getItem("/Root/List").setValue(2);alert("Clear");IWDatacapture.getItem("/Root/List").setValue();alert("item Set to 5");item.setValue(5);alert("item Set to 2");item.setValue(2);alert("item Clear");item.setValue();}
Same thing. I just did a loop to read the selections, remove and add them again. I would file a bug but it is not documented that it is supposed to work (even though it used to) so it would really be an enhancement.
iw-home/httpd/webapps/content_center/formspub/dcapi_item.js:function iwItem_setValue(value)
HiI have the same requirement in TS 6.1 . I have a multi select list box. How do i reset the selected value in the listbox.IWDatacapture.getItem("/Territory/TerritoryList").setValue();IWDatacapture.getItem("/Territory/TerritoryList").setValue(-1);Nothing is working.Rohit
var ops = IWDatacapture.getItem("/Territory/TerritoryList").getOptions();for (i = 0; i < ops.length; i++) { if (ops.value != "all") { ops.selected = false; }}IWDatacature.getItem("/Territory/TerritoryList").setOptions(ops);
textItem.setValue("") ; browserItem.setValue("") ; multiselectItem.setValue([]); // empty array singleselect.setValue ... DUH?
// Single select. Is input a single integer in range? var inputValid = (typeof value == "number" && value >= 0 && value < internal.options.length);