Combo Box - how to quickly collapse its menu?Hi, does anyone know any way(s) to quickly collapse the menu of a Combo Box once the selection is made? I have a Combo Box and do a get selected to get the selection then it proceeds to another script which takes maybe another 5 sec to fully initiate. But during this 5 sec, the Combo Box menu remains open and will not collapse until the other script finishes. I would like to have the Combo Box menu collapse nearly instantaneously after the get selected. I found that changing the focus does this (e.g. caption then remove caption), but this is kind of kludgy. Any other thoughts? thanks, DJ
Re: Combo Box - how to quickly collapse its menu?I'm not able to reproduce the problem. For the code below, the combo box collapses quickly (JMP 13 for Macintosh).
Not sure what's going on. Your "slowJSL" may contain code that can take advantage of all computing resources (multiprocessing?).
// Save example of a "slow" jsl file
Save Text File("$SAMPLE_SCRIPTS/slowJSL.jsl", "repeat({char(randominteger(1,1e6))},1e7);
print(fruit)");
New Window("test",
cb1 = Combo Box(
{"<CHOOSE>", "apple", "orange", "banana", "kiwi", "tangerine"},
fruit = cb1 << get text;
Include("$SAMPLE_SCRIPTS/slowJSL.jsl");
)
);
// Delete example jsl by running the line below
// Delete File("$SAMPLE_SCRIPTS/slowJSL.jsl");
</CHOOSE>Re: Combo Box - how to quickly collapse its menu?did you put a wait(0) at the beginning of the 2nd script?Re: Combo Box - how to quickly collapse its menu?Dj,
Can you provide a sample script , so it can be reproduced ? It will be helpful to think of the options .
Best
Uday
Re: Combo Box - how to quickly collapse its menu?Thanks for the suggestions. I did try a wait(0) and it was to no avail. Here's an example:
Issue: combo box menu does not collapse quickly after selection as it waits for the following "slowJSL.jsl" to process (I want it to process post menu selection of course). In this case "slowJSL.jsl" takes say 5 sec or so to process. The key here, is that the menu post selection just hangs and stays open in the meantime. I was hoping to close it quickly after the selection took place.
new window("test",
cb1=combo box({"<CHOOSE>","apple","orange","banana","kiwi","tangerine"},
fruit=cb1<<GET text=""></GET></CHOOSE>
Fix (though I wonder if there isn't a better way):
new window("test",
cb1=combo box({"<CHOOSE>","apple","orange","banana","kiwi","tangerine"},
cb1<<SET></SET></CHOOSE>
Re: Combo Box - how to quickly collapse its menu?Haha! Wouldn't you know I had this same issue 4 years later. I'm using JMP 12.2.0. So I ended up here to figure out a good fix.
So the Combobox() works wonders for me with its single selection and nice compact form factor. In this case now, I'm having it execute some SQL and that of course takes 3-5 sec to execute. While it is doing this, its selection menu that drives the SQL filter, would stay open for 3-5 sec after the single selection of it. Mostly its a bit annoying that's it. So I did this same fix and it worked well with the caption add/remove which quickly collapses the Combobox() menu. Doing a wait(0) had no good effect in this case.
cmb12=combobox({"thing1","thing2","thing3"},
SQLselect=cmb12<<GET selected=""></GET>
Re: Combo Box - how to quickly collapse its menu?You could replace the caption with a box giving the users a status message:
win = new window( "test",
cb1 = combo box(
{"<CHOOSE>", "apple", "orange", "banana", "kiwi", "tangerine"},
fruit = cb1 << get text;
tempwin = New Window("Your query is running", Show Menu(0), Show Toolbars(0),
Text Box("Your query is running,\!njust a moment..."));
wait(2);
tempwin << close window;
)
);
</CHOOSE>