<?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 Re: Default button selection/highlight in modal window in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Default-button-selection-highlight-in-modal-window/m-p/323061#M57308</link>
    <description>&lt;P&gt;Moving the buttons to top could be one option to avoid adding empty button to the top.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quickly testing it seems that if I don't make the New window modal, enter key press will press OK button instead of the first option of radio buttons.&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);

okPushed = 0;
nw = New Window("Modal window", Show toolbars(0), Show menu(0),
	rb = Radio Box(
		{"Option 1", "Option 2"}, &amp;lt;&amp;lt; Set(2)	
	),
	Panelbox("Actions",
		Hlistbox(
			ok_button = button box("OK", okPushed = 1; sel = rb &amp;lt;&amp;lt; get selected; nw &amp;lt;&amp;lt; close window;),
			cancel_button = button box("Cancel", okPushed = 0; nw &amp;lt;&amp;lt; close window;)
		)
	),
);
nw &amp;lt;&amp;lt; on close(
	if(okPushed == 0, show(sel, okPushed); stop(),
		show(sel, okPushed);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Oct 2020 04:26:52 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2020-10-19T04:26:52Z</dc:date>
    <item>
      <title>Default button selection/highlight in modal window</title>
      <link>https://community.jmp.com/t5/Discussions/Default-button-selection-highlight-in-modal-window/m-p/320247#M57079</link>
      <description>&lt;P&gt;Is it possible to set specific button as selected button in modal window to allow usage of that button with enter/space press?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the example script I have added I would like to have default selection to be "OK" button of modal window but by default it is set as first selection of radio box (in this case "Option 1") and I haven't figured out how to change it. I managed to do this by creating fake button as first element in the new window (selected by default) which clicks the Ok button but I feel this is a bit hacky way to get it working (commented out in the example script).&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);

okPushed = 0;
nw = New Window("Modal window", &amp;lt;&amp;lt; modal, Show toolbars(0), Show menu(0),
	//fakebutton = Button Box("     ",&amp;lt;&amp;lt; Style("underline"), &amp;lt;&amp;lt; set function(ok_button &amp;lt;&amp;lt; click)),
	rb = Radio Box(
		{"Option 1", "Option 2"}, &amp;lt;&amp;lt; Set(2)	
	),
	Panelbox("Actions",
		Hlistbox(
			ok_button = button box("OK", okPushed = 1; sel = rb &amp;lt;&amp;lt; get selected),
			cancel_button = button box("Cancel", okPushed = 0; stop();),
		)
	),
);

if(okPushed == 0, stop());
show(sel);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:40:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Default-button-selection-highlight-in-modal-window/m-p/320247#M57079</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-06-09T23:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Default button selection/highlight in modal window</title>
      <link>https://community.jmp.com/t5/Discussions/Default-button-selection-highlight-in-modal-window/m-p/322849#M57280</link>
      <description>&lt;P&gt;Can you put the OK button at the top of the window?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 22:51:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Default-button-selection-highlight-in-modal-window/m-p/322849#M57280</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2020-10-16T22:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Default button selection/highlight in modal window</title>
      <link>https://community.jmp.com/t5/Discussions/Default-button-selection-highlight-in-modal-window/m-p/322893#M57285</link>
      <description>&lt;P&gt;yes...here is an example&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 );

nw = New Window("At the Top", &amp;lt;&amp;lt; modal,
	v list box(
		button box("OK", nw &amp;lt;&amp;lt; close window ),
		spacer box(size(0,25)),
		text box(" at the bottom")
	)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Oct 2020 00:22:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Default-button-selection-highlight-in-modal-window/m-p/322893#M57285</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-10-17T00:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Default button selection/highlight in modal window</title>
      <link>https://community.jmp.com/t5/Discussions/Default-button-selection-highlight-in-modal-window/m-p/323061#M57308</link>
      <description>&lt;P&gt;Moving the buttons to top could be one option to avoid adding empty button to the top.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quickly testing it seems that if I don't make the New window modal, enter key press will press OK button instead of the first option of radio buttons.&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);

okPushed = 0;
nw = New Window("Modal window", Show toolbars(0), Show menu(0),
	rb = Radio Box(
		{"Option 1", "Option 2"}, &amp;lt;&amp;lt; Set(2)	
	),
	Panelbox("Actions",
		Hlistbox(
			ok_button = button box("OK", okPushed = 1; sel = rb &amp;lt;&amp;lt; get selected; nw &amp;lt;&amp;lt; close window;),
			cancel_button = button box("Cancel", okPushed = 0; nw &amp;lt;&amp;lt; close window;)
		)
	),
);
nw &amp;lt;&amp;lt; on close(
	if(okPushed == 0, show(sel, okPushed); stop(),
		show(sel, okPushed);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 04:26:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Default-button-selection-highlight-in-modal-window/m-p/323061#M57308</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2020-10-19T04:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Default button selection/highlight in modal window</title>
      <link>https://community.jmp.com/t5/Discussions/Default-button-selection-highlight-in-modal-window/m-p/364727#M61424</link>
      <description>&lt;P&gt;Currently using the same workaround as mentioned on the opening message with fakebutton:&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);

okPushed = 0;
nw = New Window("Modal window", &amp;lt;&amp;lt; modal, Show toolbars(0), Show menu(0),
	fakebutton = Button Box("     ",&amp;lt;&amp;lt; Style("underline"), &amp;lt;&amp;lt; set function(ok_button &amp;lt;&amp;lt; click)),
	rb = Radio Box(
		{"Option 1", "Option 2"}, &amp;lt;&amp;lt; Set(2)	
	),
	Panelbox("Actions",
		Hlistbox(
			ok_button = button box("OK", okPushed = 1; sel = rb &amp;lt;&amp;lt; get selected),
			cancel_button = button box("Cancel", okPushed = 0; stop();),
		)
	),
);

if(okPushed == 0, stop());
show(sel);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also something similar to this could most likely be used as a workaround&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/Set-focus-on-text-edit-box/m-p/215576/highlight/true#M43071" target="_self"&gt;Set focus on text edit box&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also created new wish:&amp;nbsp;&lt;A href="https://community.jmp.com/t5/JMP-Wish-List/Allow-lt-lt-SetFocus-to-be-used-with-interactive-display/idi-p/364720" target="_self"&gt;Allow &amp;lt;&amp;lt;SetFocus to be used with interactive display elements (TextEditBox, Button...) &lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 08:41:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Default-button-selection-highlight-in-modal-window/m-p/364727#M61424</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-03-03T08:41:56Z</dc:date>
    </item>
  </channel>
</rss>

