- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Need Help with Row state handler or event handler
Hi,
I am working on creating an event handler function that will switch to the histogram tab and scroll to the process distribution when a row in the process table within the summary tab is selected.
For example, if I click on “PNP4” in the table, the function should automatically switch to the histogram tab and scroll to the specific location displaying that process distribution. Any suggestions?
Here is the jsl code:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
col_names = dt << get column group( "Processes" );
tab = dt << Tabulate( Add Table( Column Table( Statistics( Mean, Std Dev ) ), Row Table( Analysis Columns( Eval( col_names ) ) ) ) );
dt2 = tab << Make Into Data Table;
tab << close window;
nw = New Window( "",
<<Type( "Dialog" ),
<<onclose(
rs = 0;
1;
),
Panel Box( ,
tabbb= Tab Box(
"Summary",
V Scroll Box(
tbbox = Table Box(
String Col Box( "Tests", (dt2:Analysis Columns << get values) ),
Number Col Box( "Mean", (dt2:Mean << get values) ),
Number Col Box( "Std Dev", (dt2:Std Dev << get values) ),
)
),
"Histogram",
vsb = V Scroll Box(
V List Box(
For Each( {col, idx}, col_names,
dt << distribution(
Stack( 1 ),
Continuous Distribution(
Column( col_names[idx] ),
Horizontal Layout( 1 ),
Normal Quantile Plot( 1 ),
Customize Summary Statistics(
Std Err Mean( 0 ),
Upper Mean Confidence Interval( 0 ),
Lower Mean Confidence Interval( 0 )
),
Vertical( 1 ),
Process Capability( 0 )
)
)
)
)
)
)
)
);
Close( dt2, nosave );
tabboxxpath = nw << XPath("//TabPageBox[text()='Summary']//TableBox");
tabboxxpath << Set Selectable Rows( 1 );
fun = Function( {a},
tabbb << set selected ( 2 );
vsb << Set Scroll Position( 0, 200 );
);
rs = tbbox << make row state handler( fun );
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need Help with Row state handler or event handler
Most likely there are better options, but here is one
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
col_names = dt << get column group("Processes");
tab = dt << Tabulate(
Add Table(Column Table(Statistics(Mean, Std Dev)), Row Table(Analysis Columns(Eval(col_names))))
);
dt2 = tab << Make Into Data Table;
tab << close window;
nw = New Window("",
<<onclose(
rs = 0;
1;
),
Panel Box(,
tb = Tab Box(
Tab Page Box(
"Summary",
V Scroll Box(
tbbox = Table Box(
String Col Box("Tests", (dt2:Analysis Columns << get values)),
Number Col Box("Mean", (dt2:Mean << get values)),
Number Col Box("Std Dev", (dt2:Std Dev << get values)),
<<Set Selectable Rows(1)
)
)
),
Tab Page Box(
"Histogram",
vsb = V Scroll Box(
V List Box(
For Each({col, idx}, col_names,
dist = dt << distribution(
Stack(1),
Continuous Distribution(
Column(col_names[idx]),
Horizontal Layout(1),
Normal Quantile Plot(1),
Customize Summary Statistics(
Std Err Mean(0),
Upper Mean Confidence Interval(0),
Lower Mean Confidence Interval(0)
),
Vertical(1),
Process Capability(0)
)
)
)
)
)
)
)
)
);
Close(dt2, nosave);
rep_height = dist << get height;
fun = Function({a},
r = a << Get Selected Rows;
tb << set selected(2);
vsb << Set Scroll Position(0, (r[1] - 1) * rep_height);
);
rs = tbbox << Set Row Change Function(fun);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need Help with Row state handler or event handler
I know row state handlers in the context of data tables:
Interesting, the table box "understands" the command as well - the sense of : doesn't complain.
But it doesn't seem to react on it ...
Curious to see the solution ...
How are the Handlers implemented for the official reports?
via Mouse Box()?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need Help with Row state handler or event handler
Table Box uses << set row change function instead of row state handler. Do you have to the "list" view of distributions in a scrollbox (instead you could for example just create one distribution and hidden column switcher to change the column)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need Help with Row state handler or event handler
cool : )
Names Default To Here( 1 );
nw = New Window( "",
<<Type( "Dialog" ),
tbbox = Table Box(
String Col Box( "string", {"A", "B"} ),
Number Col Box( "num", {1, 2} ), << set selectable rows()
)
);
fun= Function({this},
Caption("hello\!N"|| Char(this<< get selected rows))
);
tbbox << set row change function( fun);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need Help with Row state handler or event handler
Hi Jarmo,
Yes, I want to have a list view in the tab scroll box, not the column switcher.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Need Help with Row state handler or event handler
Most likely there are better options, but here is one
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
col_names = dt << get column group("Processes");
tab = dt << Tabulate(
Add Table(Column Table(Statistics(Mean, Std Dev)), Row Table(Analysis Columns(Eval(col_names))))
);
dt2 = tab << Make Into Data Table;
tab << close window;
nw = New Window("",
<<onclose(
rs = 0;
1;
),
Panel Box(,
tb = Tab Box(
Tab Page Box(
"Summary",
V Scroll Box(
tbbox = Table Box(
String Col Box("Tests", (dt2:Analysis Columns << get values)),
Number Col Box("Mean", (dt2:Mean << get values)),
Number Col Box("Std Dev", (dt2:Std Dev << get values)),
<<Set Selectable Rows(1)
)
)
),
Tab Page Box(
"Histogram",
vsb = V Scroll Box(
V List Box(
For Each({col, idx}, col_names,
dist = dt << distribution(
Stack(1),
Continuous Distribution(
Column(col_names[idx]),
Horizontal Layout(1),
Normal Quantile Plot(1),
Customize Summary Statistics(
Std Err Mean(0),
Upper Mean Confidence Interval(0),
Lower Mean Confidence Interval(0)
),
Vertical(1),
Process Capability(0)
)
)
)
)
)
)
)
)
);
Close(dt2, nosave);
rep_height = dist << get height;
fun = Function({a},
r = a << Get Selected Rows;
tb << set selected(2);
vsb << Set Scroll Position(0, (r[1] - 1) * rep_height);
);
rs = tbbox << Set Row Change Function(fun);