My confusion is , how to access the value of the option ?A text item has a name attribute. When I access this item by its name attribute, whatver value is associated with this text field, I can access it. IWDatacapture.getItem("a/b/c", "onItemChange", useThisHandler);While in case of radio item, there is no name associated with it. Option has value and selected attributes. How to access these attributes ? The values of these attributes are the ones which can be used for determining which attribute is selected. Please explain with small example. I can not understand anything from manual. Its not properly explained in manual.Thanks
Please answer following questions1) In this code, with "IWDatacapture.getItem("/position/rate").getValue();"I can get the value of the item rate, whatever is specified by the user as its a text item.
2) can I use "IWDatacapture.getItem("/position/title").getValue();"to get the value of option selected in title ? (I think NO)
3) "IWDatacapture.getItem("/position/title").getOptions();"This code will return all the options. How can I get which option is selected and the value of that option. This is explained in manual, but its very confusing.
var myOptions = item.getOptions(); // (["MGR", "..."], ["DIR", "..."], [...])var myValue = item.getValue(); // 1var selectedOption = myOptions[myValue].text; // "Engineering Director"var selectedValue = myOptions[myValue].value; // "DIR"
var val = item.getOptions()[item.getValue()].value; // "DIR"
4) When we use "onItemChange", does itemChange event mean change in item itself (selecting different option than the default) OR does it mean selecting altogether a different item is itemChange ? entering value is rate item and moving away from select options ? If its first case, then how does onItemChange trigger, when there is no select, radio or checkbox ?
5) Secondly getOptions() is a method of IWItem object, can I use getItem() and getOptions() together , eevnthough they are from different objects ?
6) cityItem.getOptions()[parseInt(cityItem.getValue())].value(i)I dont understand this syntax. getOptions() will get options from cityItem item. When it gets all the options, does it only get values from value attribute or does it get values of label and selected attributes also ?
(ii)[parseInt(cityItem.getValue())].value , how does this operate on options ? It is not connected by any operator (.) with cityItem.getOptions().
(iii) When we do cityItem.getValue(), does it retrieve all the values from the value attribute in option list ? (Just like as getValue() retrieves value from text item OR does this getValue() on option list something else ?)
(iv) what does the value attached to "cityItem.getValue().value" do ? Does it get the value of selected attribute from selected option or something else ? Please explain this syntax. Its full of confusion.