Hi All,
I'm working on a larger set of JSL code and am interested in adding some functionality to it so that the user can cycle through different views -- something like what one can do when cycling through the different components in the PCA platform, see screen shot below.

I know that I need a couple Combo Boxes with the relevant columns from the data table, but I'm not sure how to get the graph to auto-update like in the PCA platform or how to correctly call the Next button box. I would also like to add in a Previous button box so the user can step back in the view more easily.
If anyone has some suggestions or ideas on how to implement this, I'd appreciate the help. I haven't been successful searching for this functionality or finding much about it in the Scripting Index or Scripting Guide that I have.
Thanks!,
DS
UPDATE: I am getting closer and have a code that cycles through the list in the combo box, so that's pretty straightforward (see below). What I'm still having trouble with is getting the graph to update automatically. The intent is when the user clicks Next or Prev, the y variable changes automatically in the graph. BTW, I am using the Boston Housing.jmp file to test it out.
Names Default To Here( 1 );
dt = Data Table( "Boston Housing" );
xlist = dt << Get Column Names( String );
nw = New Window( "interactive Graph builder", V List Box( vlb1 = V List Box(), vlb2 = V List Box() ) );
xcol = 1;
ycol = 2;
lbcontent = V List Box(
Lineup Box( N Col( 5 ),
Text Box( "Select Params", <<Set Font Size( 11 ) ),
xcb = Combo Box( xlist ),
ycb = Combo Box( xlist, <<Set( 2 ) ),
pbb = Button Box( "Prev",
<<SetIcon( "PrevSeq" ),
<<Set Icon Location( "left" ),
<<Set Function(
Function( {},
ycb << Set( ycol - 1 );
Return( ycol = ycb << Get );
)
)
),
nbb = Button Box( "Next",
<<Set Icon( "NextSeq" ),
<<Set Icon Location( "right" ),
<<Set Function(
Function( {},
ycb << Set( ycol + 1 );
Return( ycol = ycb << Get );
)
)
)
)
);
vlb2 << Append( lbcontent );
gbcontent = V List Box( Graph builder( Show Control Panel( 0 ), Variables( X( Column( dt, xcol ) ), Y( Column( dt, ycol ) ) ) ) );
vlb1 << Append( gbcontent );