Question 2: myArray.push(ItemVar); whereas ItemVar can be anything (even an array)
Question 1: No, there is not a method to retrieve the current selection. You can, however, do this:
JScript code:
var SelectedItem = -1;
function OnWndTestEvent_LstViewClicked(PlusWnd,ControlId,ItemIdx) {
if(ControlId == "vLstTest") {
SelectedItem = ItemIdx;
<do_other_stuff>
}
}
Make sure though that you catch all selection-related events and set SelectedItem accordingly. They are:
- OnWindowIdEvent_LstViewClicked();
- OnWindowIdEvent_LstViewDblClicked();
- OnWindowIdEvent_LstViewRightClicked();
A value of -1 means that no item is currently selected. That means, for example, there is only one item in the list-view control, and you click below that item.
Also, make sure to set SelectedItem back to -1 when the window is destroyed.