Append an Open Window after a selection is madeI have been searching for a solution to be able to append an open window after a selection is made from from a calendar box.
Once the Start Date and End Date are selected I would like to open another box right below the panel box that holds the calendar(s)
Below is an example i am trying in the simplfied version. In my actual application I would like to open a check box() list based on the dates selected from a database that was based on an sql script..
Thank You
<BR />nw = New Window( "Example",
V List Box(
pb = Panel Box( "Calendar",
V List Box(
H List Box(
Panel Box( "Select Start",
StartDate = Calendar Box(
<< Set Function(
Function(
{f1},
sqlstartA = StartDate << Get Date();
)
)
)
), // End StartDate Calendar Box
Panel Box( "Select End",
EndDate = Calendar Box(
<< Set Function(
Function(
{f2},
sqlendA = EndDate << Get Date();
)
)
)
) // End EndDate Calendar Box
),
H List Box(
bb1 = Button Box( "Set Dates",
sqlstart = format(sqlstartA, "yyyy-mm-dd");
sqlend = format(sqlendA, "yyyy-mm-dd");
show(sqlstart, sqlend);
),
bb2 = Button Box( "Cancel" )
),
Wait( 0.1 ),
pb << Append(
Text Box( "Why isn't this working" )
)
)
)
)
);
Re: Append an Open Window after a selection is madeThank you very much.. I was trying a Wait() in between that part of the
code.. When i was reading the forums i saw something about Pause before
executing a script and saw the beep() however i didn't even think about
putting that in there..
Thanks you very much again..
Re: Append an Open Window after a selection is madeOf course I don't have your DB. But, making corresponding simplifications to your code, this shows the mechanics of adding the check box to the UI.
/* -----------------------------------------------------------*/
/* Calendar Box to Select Start and End Dates */
/* -----------------------------------------------------------*/
nw = New Window( "Example",
V List Box(
pb = Panel Box( "Calendar",
V List Box(
H List Box(
Panel Box( "Select Start", StartDate = Calendar Box( <<SET function=""></SET>
Re: Append an Open Window after a selection is madeAllow me to expand on that if I may.
Now that you got that to work with a text box the actual solution i am trying to solve is placing a check box that gets populated when you push Set Dates. I tried to insert LotListBox = Check Box( LotList, doListChoice ); in place of the Text Box() and i am only getting the panel window..
From what i can gather the the last 4 sets of script isn't executing therefore just sending an empty window.
/* -----------------------------------------------------------*/
/* Calendar Box to Select Start and End Dates */
/* -----------------------------------------------------------*/
nw = New Window( "Example",
V List Box(
pb = Panel Box( "Calendar",
V List Box(
H List Box(
Panel Box( "Select Start",
StartDate = Calendar Box(
<<SET function="">= ' " || sqlstart || " '
AND t1.testdate <= ' " || sqlend || " '
AND (t1.wafer_number NOT RLIKE '-ATL' )
ORDER BY t1.testdate DESC
"
);
/*****************************************************************************/
/* */
/* Brings in the list of wafers from the SQL Query */
/* */
/*****************************************************************************/
/**************************************************************/
/* Opens Database based on Calendar Dates and Lists Lots */
/**************************************************************/
// Tried to put this in an expression to execute in the main window
dtLotList = Expr(
dt_LotList = Open Database( <DATABASE string="">, SQLcode, "LotList" );
Summarize( LotList = By( :wafer_number ) );
Close( dt_lotlist, No Save );
);
// Original script to bring in a list of wafers within the date range
dt_LotList = Open Database( <DATABASE string="">, SQLcode, "LotList" );
Summarize( LotList = By( :wafer_number ) );
Close( dt_lotlist, No Save );
/**************************************************************/
/* Lists Lot List in Check Box Format */
/**************************************************************/
// This is what i would like to be appended in the first window
LotListBox = Check Box( LotList, doListChoice );
/**************************************************************/
/* Allows for Multiple Lots to be Selected */
/**************************************************************/
doListChoice = Expr(
SelectedLot = LotListBox << get selected; //get the selected items
If( N Items( SelectedLot ) > 0, //run through each selected item if there are any
For( i = 1, i <= N Items( SelectedLot ), i++,
Print( SelectedLot[i] )
)
);
LotListSQLString = "";
For( i = 1, i <= N Items( SelectedLot ), i++,
LotListSQLString = LotListSQLString || "'" || Char( SelectedLot[i] );
If( i == N Items( SelectedLot ),
LotListSQLString = LotListSQLString || "'",
LotListSQLString = LotListSQLString || "',"
);
);
Show( SelectedLot );
);</DATABASE></DATABASE></SET>
Re: Append an Open Window after a selection is madeThat is crazy because it wasn't working... Thank you for pointing that outRe: Append an Open Window after a selection is madeWorking in a hurry, I'm not sure what I did to your original. But the code below does indeed work. Generally I find it helps readability and maintainability to define actions as expressions with a name, then invoke them using that name.
nw = New Window( "Example",
V List Box(
pb = Panel Box( "Calendar",
V List Box(
H List Box(
Panel Box( "Select Start",
StartDate = Calendar Box(
<<SET function=""></SET>