Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- Check Box question with subgroups with select all of each subgroup fails

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Mar 17, 2020 6:54 AM
(681 views)

Hello Folks! I have generated a user window to select any from 2 series of charts. The series are "Only curves" or "Curves and data points". My issue is that I also need to have a "Select all Curves" and "Select all Curves and Points" options. The two "Select All" check boxes work great. However, if I select anything on the Curve chart side and DO NOT select the "Select all Curves and Points" check box (even to select and deselect), rather I select one or more individually, the selected Curve and Data Point charts are not entered into the list of charts to produce. What am I doing wrong? Code included. Thank you all in advance for looking at my issue!

```
//Generate charts for selected data
GetCharts = {};
GetDPCharts = {};
//Window for user to select which charts to be generated
WhatCharts = New Window( "Select Curve Charts to Generate", << Modal,
<< On open( WhatCharts << Window Size( 200, 100 ) ),
H List Box(
//All charts wtih ONLY curves
cbAllCharts = Check Box( {"By Condition", "By Cond No", "By Sample", "Average by Condition"} ),
Spacer Box( Size( 10, 0 ) ),
//Charts with Data Points AND Curves
cbAllDPCharts = Check Box( {"By Condition w/ Data Points", "By Cond No w/ Data Points", "By Sample w/ Data Points", "Average by Condition w/ Data Points"})
),
//Allow the user to select all charts
H List Box(
cbAll = Check Box( " ",
<< Set Function(
Function( {this},
cbAllCharts << Set All( this << Get, run script( 1 ) )
)
),
),
Text Box( "Select All Curve Plots" ),
Spacer Box( Size( 9, 0 ) ),
cbAll2 = Check Box( " ",
<< Set Function(
Function( {this},
cbAllDPCharts << Set All( this << Get, run script( 1 ) )
)
),
),
Text Box( "Select all Points and Curve Plots" ),
),
H Center Box( Button Box( "OK", GetChkBoxes )
)
);
//Place all selections into one list
if( N Items( GetDPCharts ) > 0,
For( i = 1, i<= N Items( GetDPCharts ), i++,
Insert Into( GetCharts, GetDPCharts[i] )
)
);
//Expressions
GetChkBoxes = Expr(
GetCharts = cbAllCharts << Get Selected;
GetDPCharts = cbAllDPCharts << Get Selected;
);
Print( GetCharts, GetDPCharts );
```

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Give each checkbox it's own function and make sure all functions have different names:

```
//Generate charts for selected databutton
GetCharts = {};
GetDPCharts = {};
//Window for user to select which charts to be generated
WhatCharts = New Window( "Select Curve Charts to Generate", << Modal, << Return Result,
//<< On open( WhatCharts << Window Size( 200, 100 ) ),
H List Box(
//All charts wtih ONLY curves
cbAllCharts = Check Box( {"By Condition", "By Cond No", "By Sample", "Average by Condition"},
<<SetFunction( Function( {f1}, GetCharts = cbAllCharts << get selected ) ) ),
Spacer Box( Size( 10, 0 ) ),
//Charts with Data Points AND Curves
cbAllDPCharts = Check Box( {"By Condition w/ Data Points", "By Cond No w/ Data Points", "By Sample w/ Data Points", "Average by Condition w/ Data Points"},
<<SetFunction( Function( {f2}, GetDPCharts = cbAllDPCharts << get selected ) ) ),
),
//Allow the user to select all charts
H List Box(
cbAll = Check Box( " ",
<< Set Function(
Function( {f3},
cbAllCharts << Set All( f3 << Get, run script( 1 ) )
)
),
),
Text Box( "Select All Curve Plots" ),
Spacer Box( Size( 9, 0 ) ),
cbAll2 = Check Box( " ",
<< Set Function(
Function( {f4},
cbAllDPCharts << Set All( f4 << Get, run script( 1 ) )
)
),
),
Text Box( "Select all Points and Curve Plots" ),
),
H List Box( Button Box( "OK" ) )
);
//Place all selections into one list
if( N Items( GetDPCharts ) > 0,
For( i = 1, i<= N Items( GetDPCharts ), i++,
Insert Into( GetCharts, GetDPCharts[i] )
)
);
Print( GetCharts, GetDPCharts );
```

2 REPLIES 2

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Give each checkbox it's own function and make sure all functions have different names:

```
//Generate charts for selected databutton
GetCharts = {};
GetDPCharts = {};
//Window for user to select which charts to be generated
WhatCharts = New Window( "Select Curve Charts to Generate", << Modal, << Return Result,
//<< On open( WhatCharts << Window Size( 200, 100 ) ),
H List Box(
//All charts wtih ONLY curves
cbAllCharts = Check Box( {"By Condition", "By Cond No", "By Sample", "Average by Condition"},
<<SetFunction( Function( {f1}, GetCharts = cbAllCharts << get selected ) ) ),
Spacer Box( Size( 10, 0 ) ),
//Charts with Data Points AND Curves
cbAllDPCharts = Check Box( {"By Condition w/ Data Points", "By Cond No w/ Data Points", "By Sample w/ Data Points", "Average by Condition w/ Data Points"},
<<SetFunction( Function( {f2}, GetDPCharts = cbAllDPCharts << get selected ) ) ),
),
//Allow the user to select all charts
H List Box(
cbAll = Check Box( " ",
<< Set Function(
Function( {f3},
cbAllCharts << Set All( f3 << Get, run script( 1 ) )
)
),
),
Text Box( "Select All Curve Plots" ),
Spacer Box( Size( 9, 0 ) ),
cbAll2 = Check Box( " ",
<< Set Function(
Function( {f4},
cbAllDPCharts << Set All( f4 << Get, run script( 1 ) )
)
),
),
Text Box( "Select all Points and Curve Plots" ),
),
H List Box( Button Box( "OK" ) )
);
//Place all selections into one list
if( N Items( GetDPCharts ) > 0,
For( i = 1, i<= N Items( GetDPCharts ), i++,
Insert Into( GetCharts, GetDPCharts[i] )
)
);
Print( GetCharts, GetDPCharts );
```

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Check Box question with subgroups with select all of each subgroup fails

AWESOME! Thank you for the tutorial and furthering my JSL understanding and toolbox!

Article Labels

There are no labels assigned to this post.