@jthi Thanks, I would have never figured that out.
However, the updated script below is not passing the value of returnedPid as an argument to my function fetchChildIds (:
Names Default To Here (1);
clear log ();
include ("_fetchChildIds.jsl");
//aa_parents << Set Default Value({});
get_childids = function({this}, {Default Local},
//new_childids = aa_parents[(this << prev sib) << get text];
new_childids = fetchChildIds (returnedPid);
lb_child << Set items(new_childids);
);
nw = New Window("Fetch Summary Data ", << Modal, <<Return Result,
H List Box(
Panel Box("[1] Enter Parent ID", //sets outside panel
Lineup Box(N Col(2),
pid = Text Edit Box("", << Set Width(150)),
Button Box("Get Child ID(s)",
returnedPid = pid << get text, // this = pid << get text, //also does not seem correct
<< set function(function({this},
get_childids(this);
)))
)
),
Panel Box("[2] Select Child ID",
H List Box(
lb_child = List Box({}),
Lineup Box(N Col(1),
Button Box("Select All",
For Each({item, idx}, lb_child << get items,
lb_child << Set Selected(idx);
);
wait(0);
),
Button Box("Unselect All",
lb_child << Clear selection;
),
)
)
),
Panel Box("[3] Fetch Test Data",
Lineup Box(N Col(1),
Button Box("OK"),
Button Box("Cancel")
)
)
)
);
When it's too good to be true, it's neither