Slán,
Below is a simple combining of your script with the script referenced in How to create a Recall button on a custom window. To start with, your provided example uses a Column Dialog() and the Recall Example uses a New Window for the user dialog. JMP had depreciated the Column Dialog in favor of New Window. What you need to do is to study the script and learn how it works. It brings in several items that will take some understanding. NameSpaces being a major one.
Names Default To Here( 1 );
/* Assign dt to reference a table. Open a sample table for demonstration purposes */
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
/* Use a named namespace to hold the recall values */
If( !Namespace Exists( "Custom Dialog" ), // define namespace if it does not exist
dialogRecallNS = New Namespace(
"Custom Dialog",
{
ycolRecall =
{
}
,
orderRecall =
{
}
,
byRecall =
{
}
}
)
, // else get a reference to the existing namespace
dialogRecallNS = Namespace( "Custom Dialog" )
);
nc = N Col( dt );
lbWidth = 130;
// The program to execute when the OK button is pressed
pgm = Expr(
nw = New Window( "Annotated Multiple Plots",
For( i = 1, i <= N Items( exy ), i++,
Notes = Try( exy[i] << Get Property( "Notes" ) );
Try(
Bivariate(
Y( exy[i] ),
X( exx[1] ),
SendToReport(
Dispatch( {}, "", AxisBox( 2 ),
Add Text Annotation(
Text( "Category: " || Notes ),
Fixed Size( 0 ),
Text Box( {-80, 25, 0, 50} ),
Filled( 0 )
)
)
)
)
);
)
)
);
/* Expression to clear all current settings */
clearRoles = Expr(
colListY << RemoveAll;
colListX << RemoveAll;
);
/* Expression to store the current settings in global variables */
recallRoles = Expr(
dialogRecallNS:ycolRecall = colListY << GetItems;
dialogRecallNS:orderRecall = colListX << GetItems;
);
/* Custom Launch Window */
customDlg = New Window( "Example of a Custom Dialog",
Border Box( Left( 3 ), top( 2 ),
V List Box(
Text Box( "Example dialog to demonstrate a Recall button" ),
H List Box(
V List Box(
Panel Box( "Select Columns",
colListData = Col List Box( All, width( lbWidth ), nLines( Min( nc, 10 ) ) )
)
),
Panel Box( "Cast Selected Columns into Roles",
Lineup Box( N Col( 2 ), Spacing( 3 ),
Button Box( "Y", colListY << Append( colListData << GetSelected ) ),
colListY = Col List Box( width( lbWidth ), nmin( 1 ), nLines( 5 ), numeric ),
Button Box( "X", colListX << Append( colListData << GetSelected ) ),
colListX = Col List Box( width( lbWidth ), nLines( 1 ), numeric )
)
),
Panel Box( "Action",
Lineup Box( N Col( 1 ),
Button Box( "OK",
recallRoles;
exy = colListY << get items;
exx = colListX << get items;
pgm;
customDlg << CloseWindow;
),
Button Box( "Cancel", customDlg << CloseWindow ),
Button Box( "Reset", clearRoles ),
Text Box( " " ),
Button Box( "Remove",
colListY << RemoveSelected;
colListX << RemoveSelected;
),
Button Box( "Recall",
clearRoles;
/* Restore any previous settings from the namespace variables */
Try(
colListY << Append( dialogRecallNS:ycolRecall );
colListX << Append( dialogRecallNS:orderRecall );
);
)
)
)
)
)
)
);
colListx << set min items( 1 );
colListy << set min items( 1 );
Please note that I removed several line of code in your supplied JSL that did not seem to do anything for the example.
Jim