I spend some time created a jsl script, which provide user interface to specify some criteria and pull data from Amazon Redshift based on user input. The script is working well but having a small issue.
Once user clicks on query button on a modal window, it set a variable isValid = 1, close itself to execute subsequent script, which will then create a progress window that display message like "pulling data, please wait..." and starting the query on open. It should close itself after the query is done.
The problem is, this progress window cannot be see (not showing up) on my screen. It seems like JMP run the query script immediately after the window was created before it is being bring to front, although the query is successful.
I try to insert wait(0) or bring window to front before query script, still no luck. I can only see the progress window only if I remark the query part.
What I can do to make the window show up and running query script at the same time?
/*scripts before this line are not related to the issue, hence not included*/
If(isValid == 1,
nwQuery = New Window( "Query", <<Show Menu( 0 ), <<Show Toolbars( 0 ), << Modal,
Lineup Box(N Col(2), Busy Light(<< Automatic, size(40,40)), Text Box("Pulling data, please wait...")),
bbOk = Button Box("Ok", << Visibility("Collapse"), << Set Function(Function({thisBox},
Wait(0);
/* some action in preparing query criteria
window show up if remark below lines */
mySQL = Eval Insert(tpSQL);
dbc = Create Database Connection("DSN=Amazon Redshift; UID=***; PSW=***");
dt = Execute SQL (dbc, mySQL, "Query");
close database connection(dbc);
// add wait(2); if remark above lines
bbOk << Close Window;
))),
bbOk << Click;
);
);