I'm trying to get user selected items from a listview with the simpler method without event loops as I don't need any real-time reactions, so I run an "attached" dialog
var Dlg = clickData.func.Dlg; Dlg.window = tab; Dlg.template = "Tabs";
Dlg.Create(); // create a detached
///... configure dialog
var retVal = Dlg.RunDlg(); // run as attached
But then I can't accessDlg.Control anymore after I get a return value.
So this
var lvtest = Dlg.Control('ctrlname');
p("pre f lvtest # " + lvtest.count); // works
var retVal = Dlg.RunDlg();
var lvtest = Dlg.Control('ctrlname'); // fails
p("pos f lvtest # " + lvtest.count);
Am I correct that it's simply destroyed? And how can I get the selection items at the moment of destruction?
The control no longer exists once RunDlg returns so most properties don't work, but you should still be able to get information about which items were selected.
Hm, for multiselected listview I thought I'd get a value of listitems, but I only get a vector of ints
Note that for a multiple-selection list box or list view , this value will return a Vector of DialogListItem objects, representing all currently selected items
Hard to guess what's wrong if you don't show us the code, but this works:
...
var retVal = Dlg.RunDlg();
var sel = Dlg.Control('lv1').value;
DOpus.Output("TypeOf sel = " + DOpus.TypeOf(sel));
for (var i = 0; i < sel.count; ++i)
DOpus.Output("Selected " + i + " = " + sel(i).name);