<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Check box won't show up in an input prompt input in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Check-box-won-t-show-up-in-an-input-prompt-input/m-p/774913#M95701</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// New dialog for script selection
scripts = {"Box Plot", "Box Plot_sublot_trend", "Box Plot_duration_trend", "Box Plot_FT1vsFT2", "Tabulation", "CDF&amp;amp;PDF11"};
scriptSelections = J(1, N Items(scripts), 0);

// Initialize the checkboxes array
cb = {};

nw2 = New Window("Script Selection", &amp;lt;&amp;lt;modal,
    &amp;lt;&amp;lt;onClose(
        For(i = 1, i &amp;lt;= N Items(scripts), i++,
            scriptSelections[i] = cb[i] &amp;lt;&amp;lt; Get;
        );
    ),
    VListBox(
        Text Box("Select the scripts to run:"),
        Panel Box("Scripts",
            V List Box(
                For(i = 1, i &amp;lt;= N Items(scripts), i++,
                    cb[i] = Check Box(scripts[i], 0);
                )
            )
        ),
        HListBox(
            Button Box("OK", nw2 &amp;lt;&amp;lt; Close(1)),
            Spacer Box(size(6, 0)),
            Button Box("Cancel", nw2 &amp;lt;&amp;lt; Close(0))
        )
    )
);

if (nw2["Button"] == -1, throw());

selectedScripts = {};

For(i = 1, i &amp;lt;= N Items(scripts), i++,
    If(scriptSelections[i] == 1,
        Insert Into(selectedScripts, scripts[i]);
    );
);

New Window("My report",
    VListBox(
        MyGraph(::yColName, ::xColName, ::xGroupName)
    )
);

// Include selected scripts
For(i = 1, i &amp;lt;= N Items(selectedScripts), i++,
    Include(selectedScripts[i] || ".jsl");
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So I have several sub scripts for my main script to call, I wanted to create a checkbox where the user can select which sub scripts to run (from &lt;CODE class=" language-jsl"&gt;Box Plot", "Box Plot_sublot_trend", "Box Plot_duration_trend", "Box Plot_FT1vsFT2", "Tabulation", "CDF&amp;amp;PDF11&lt;/CODE&gt;.) But no matter what I do I only get an empty window with the line " Select Scripts to run".&lt;/P&gt;&lt;P&gt;How can I solve this? Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2024 23:23:46 GMT</pubDate>
    <dc:creator>ARETI052</dc:creator>
    <dc:date>2024-07-23T23:23:46Z</dc:date>
    <item>
      <title>Check box won't show up in an input prompt input</title>
      <link>https://community.jmp.com/t5/Discussions/Check-box-won-t-show-up-in-an-input-prompt-input/m-p/774913#M95701</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// New dialog for script selection
scripts = {"Box Plot", "Box Plot_sublot_trend", "Box Plot_duration_trend", "Box Plot_FT1vsFT2", "Tabulation", "CDF&amp;amp;PDF11"};
scriptSelections = J(1, N Items(scripts), 0);

// Initialize the checkboxes array
cb = {};

nw2 = New Window("Script Selection", &amp;lt;&amp;lt;modal,
    &amp;lt;&amp;lt;onClose(
        For(i = 1, i &amp;lt;= N Items(scripts), i++,
            scriptSelections[i] = cb[i] &amp;lt;&amp;lt; Get;
        );
    ),
    VListBox(
        Text Box("Select the scripts to run:"),
        Panel Box("Scripts",
            V List Box(
                For(i = 1, i &amp;lt;= N Items(scripts), i++,
                    cb[i] = Check Box(scripts[i], 0);
                )
            )
        ),
        HListBox(
            Button Box("OK", nw2 &amp;lt;&amp;lt; Close(1)),
            Spacer Box(size(6, 0)),
            Button Box("Cancel", nw2 &amp;lt;&amp;lt; Close(0))
        )
    )
);

if (nw2["Button"] == -1, throw());

selectedScripts = {};

For(i = 1, i &amp;lt;= N Items(scripts), i++,
    If(scriptSelections[i] == 1,
        Insert Into(selectedScripts, scripts[i]);
    );
);

New Window("My report",
    VListBox(
        MyGraph(::yColName, ::xColName, ::xGroupName)
    )
);

// Include selected scripts
For(i = 1, i &amp;lt;= N Items(selectedScripts), i++,
    Include(selectedScripts[i] || ".jsl");
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So I have several sub scripts for my main script to call, I wanted to create a checkbox where the user can select which sub scripts to run (from &lt;CODE class=" language-jsl"&gt;Box Plot", "Box Plot_sublot_trend", "Box Plot_duration_trend", "Box Plot_FT1vsFT2", "Tabulation", "CDF&amp;amp;PDF11&lt;/CODE&gt;.) But no matter what I do I only get an empty window with the line " Select Scripts to run".&lt;/P&gt;&lt;P&gt;How can I solve this? Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 23:23:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Check-box-won-t-show-up-in-an-input-prompt-input/m-p/774913#M95701</guid>
      <dc:creator>ARETI052</dc:creator>
      <dc:date>2024-07-23T23:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Check box won't show up in an input prompt input</title>
      <link>https://community.jmp.com/t5/Discussions/Check-box-won-t-show-up-in-an-input-prompt-input/m-p/774975#M95704</link>
      <description>&lt;P&gt;There is no need to use For loop with check boxes.&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/display-functions.shtml?os=win&amp;amp;source=application#ww2571066" target="_blank"&gt;Display Functions (jmp.com)&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/construct-display-boxes-for-new-windows.shtml#ww196934" target="_blank"&gt;Construct Display Boxes for New Windows (jmp.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This might not be exactly correct but gives an idea how to use checkboxes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
// New dialog for script selection
scripts = {"Box Plot", "Box Plot_sublot_trend", "Box Plot_duration_trend", "Box Plot_FT1vsFT2",
"Tabulation", "CDF&amp;amp;PDF11"};
scriptSelections = J(1, N Items(scripts), 0);

// Initialize the checkboxes array
cb = {};

nw2 = New Window("Script Selection",
	&amp;lt;&amp;lt;modal,
	V List Box(
		Text Box("Select the scripts to run:"),
		Panel Box("Scripts",
			cb = Check Box(scripts)
		),
		H List Box(
			Button Box("OK", cb &amp;lt;&amp;lt; get selected),
			Spacer Box(size(6, 0)),
			Button Box("Cancel")
		)
	)
);

If(nw2["Button"] == -1,
	Throw()
);

selectedScripts = {};

For(i = 1, i &amp;lt;= N Items(scripts), i++,
	If(scriptSelections[i] == 1,
		Insert Into(selectedScripts, scripts[i])
	)
);

New Window("My report", V List Box(MyGraph(::yColName, ::xColName, ::xGroupName)));

// Include selected scripts
For(i = 1, i &amp;lt;= N Items(selectedScripts), i++,
	Include(selectedScripts[i] || ".jsl")
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also do not use &amp;lt;&amp;lt; close window on modal window, you will run into all sorts of issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 04:41:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Check-box-won-t-show-up-in-an-input-prompt-input/m-p/774975#M95704</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-24T04:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Check box won't show up in an input prompt input</title>
      <link>https://community.jmp.com/t5/Discussions/Check-box-won-t-show-up-in-an-input-prompt-input/m-p/775191#M95724</link>
      <description>&lt;P&gt;Thanks for the reply, I got that to work, but once I integrated the "&amp;lt;&amp;lt;Get Selected" function to my script, I got the Error "Not a Name" which I can't figure out what's wrong, any suggestions for solving this? Thanks.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// New dialog for script selection
scripts = {"Box Plot", "Box Plot_sublot_trend", "Box Plot_duration_trend", "Box Plot_FT1vsFT2", "Tabulation", "CDF&amp;amp;PDF11"};

// Initialize the checkboxes array
cb = {};

nw2 = New Window("Script Selection",
    &amp;lt;&amp;lt;modal,
    V List Box(
        Text Box("Select the scripts to run:"),
        Panel Box("Scripts",
            cb = Check Box(scripts)
        ),
        H List Box(
            Button Box("OK", Dialog(1)),
            Spacer Box(size(6, 0)),
            Button Box("Cancel", Dialog(0))
        )
    )
);

// Check if the user clicked OK or Cancel
If(nw2["Button"] == 0, // If Cancel button is clicked
    Close(nw2);
    Throw()
);

// Collect the selected scripts based on checkbox input
selectedScripts = cb &amp;lt;&amp;lt; get selected;

// Close the script selection window
Close(nw2);

// Open a new window for the report
New Window("My report", V List Box(MyGraph(::yColName, ::xColName, ::xGroupName)));

// Include the selected scripts using if statements
If(Contains(selectedScripts, "Box Plot"),
    Include("Box Plot.jsl");
);

If(Contains(selectedScripts, "Box Plot_sublot_trend"),
    Include("Box Plot_sublot_trend.jsl");
);

If(Contains(selectedScripts, "Box Plot_duration_trend"),
    Include("Box Plot_duration_trend.jsl");
);

If(Contains(selectedScripts, "Box Plot_FT1vsFT2"),
    Include("Box Plot_FT1vsFT2.jsl");
);

If(Contains(selectedScripts, "Tabulation"),
    Include("Tabulation.jsl");
);

If(Contains(selectedScripts, "CDF&amp;amp;PDF11"),
    Include("CDF&amp;amp;PDF11.jsl");
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jul 2024 18:22:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Check-box-won-t-show-up-in-an-input-prompt-input/m-p/775191#M95724</guid>
      <dc:creator>ARETI052</dc:creator>
      <dc:date>2024-07-24T18:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Check box won't show up in an input prompt input</title>
      <link>https://community.jmp.com/t5/Discussions/Check-box-won-t-show-up-in-an-input-prompt-input/m-p/775193#M95725</link>
      <description>&lt;P&gt;As you are using &amp;lt;&amp;lt; modal window you have to collect the results before it is closed&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nw2 = New Window("Script Selection",
	&amp;lt;&amp;lt;modal,
	V List Box(
		Text Box("Select the scripts to run:"),
		Panel Box("Scripts", cb = Check Box(scripts)),
		H List Box(
			Button Box("OK", selectedScripts = cb &amp;lt;&amp;lt; get selected),
			Spacer Box(size(6, 0)),
			Button Box("Cancel")
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then remove &lt;CODE class=" language-jsl"&gt;selectedScripts = cb &amp;lt;&amp;lt; get selected&lt;/CODE&gt; after the modal. You should also remove all the parts where you are trying to close nw2 as it is already closed when user presses OK/Cancel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

scripts = {"Box Plot", "Box Plot_sublot_trend", "Box Plot_duration_trend", "Box Plot_FT1vsFT2",
"Tabulation", "CDF&amp;amp;PDF11"};

nw2 = New Window("Script Selection",
	&amp;lt;&amp;lt;modal,
	V List Box(
		Text Box("Select the scripts to run:"),
		Panel Box("Scripts", cb = Check Box(scripts)),
		H List Box(
			Button Box("OK", selectedScripts = cb &amp;lt;&amp;lt; get selected),
			Spacer Box(size(6, 0)),
			Button Box("Cancel")
		)
	)
);

If(nw2["Button"] != 1, 
	// Throw("Cancel Pressed");
	stop();
);

// Close the script selection window

// Open a new window for the report
//New Window("My report", V List Box(MyGraph(::yColName, ::xColName, ::xGroupName)));

For Each({scriptname}, selectedScripts,
	script_path = scriptname || ".jsl";
	If(File Exists(script_path),
		Include(script_path)
	,
		Write("\!N", script_path, " doesn't exist!");
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jul 2024 18:49:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Check-box-won-t-show-up-in-an-input-prompt-input/m-p/775193#M95725</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-24T18:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Check box won't show up in an input prompt input</title>
      <link>https://community.jmp.com/t5/Discussions/Check-box-won-t-show-up-in-an-input-prompt-input/m-p/775194#M95726</link>
      <description>&lt;P&gt;Thank you so much!!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 19:24:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Check-box-won-t-show-up-in-an-input-prompt-input/m-p/775194#M95726</guid>
      <dc:creator>ARETI052</dc:creator>
      <dc:date>2024-07-24T19:24:25Z</dc:date>
    </item>
  </channel>
</rss>

