<?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: Setting Default Selected Item in a Combo Box in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Setting-Default-Selected-Item-in-a-Combo-Box/m-p/843122#M101679</link>
    <description>&lt;P&gt;Extending a little on bens solution&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

options = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
initial_option = "7";

nw = New Window( "Test", 
	combob = Combo Box(options, &amp;lt;&amp;lt; Set(Contains(options, initial_option)))
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Scripting Index is usually good place to start&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1740054668783.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73213iAEB95F3121E1C0B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1740054668783.png" alt="jthi_0-1740054668783.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Feb 2025 12:31:34 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-02-20T12:31:34Z</dc:date>
    <item>
      <title>Setting Default Selected Item in a Combo Box</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-Default-Selected-Item-in-a-Combo-Box/m-p/843098#M101677</link>
      <description>&lt;DIV&gt;&lt;SPAN class=""&gt;When using a combo box, how can I set it to display the currently selected item by default? For example, if the default is the first item, which is "1", what should I do to have the combo box show "7" as the currently selected item by default, as shown in the image below?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BabyDoragon_0-1740049027630.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73211i6194B5AEE6401E8C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BabyDoragon_0-1740049027630.png" alt="BabyDoragon_0-1740049027630.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
New Window( "Test", 

	testCB = Combo Box( a, )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 20 Feb 2025 10:57:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-Default-Selected-Item-in-a-Combo-Box/m-p/843098#M101677</guid>
      <dc:creator>BabyDoragon</dc:creator>
      <dc:date>2025-02-20T10:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Default Selected Item in a Combo Box</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-Default-Selected-Item-in-a-Combo-Box/m-p/843108#M101678</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/59007"&gt;@BabyDoragon&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the 'set' function to place it into the position on the list (this has to be the numbered order for the combo box list)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
New Window( "Test", 

	testCB = Combo Box( a, )
);

testcb&amp;lt;&amp;lt;set (1); //set to first position&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Feb 2025 11:04:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-Default-Selected-Item-in-a-Combo-Box/m-p/843108#M101678</guid>
      <dc:creator>Ben_BarrIngh</dc:creator>
      <dc:date>2025-02-20T11:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Default Selected Item in a Combo Box</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-Default-Selected-Item-in-a-Combo-Box/m-p/843122#M101679</link>
      <description>&lt;P&gt;Extending a little on bens solution&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

options = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
initial_option = "7";

nw = New Window( "Test", 
	combob = Combo Box(options, &amp;lt;&amp;lt; Set(Contains(options, initial_option)))
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Scripting Index is usually good place to start&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1740054668783.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73213iAEB95F3121E1C0B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1740054668783.png" alt="jthi_0-1740054668783.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 12:31:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-Default-Selected-Item-in-a-Combo-Box/m-p/843122#M101679</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-02-20T12:31:34Z</dc:date>
    </item>
  </channel>
</rss>

