<?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: how to remove items from list box in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-to-remove-items-from-list-box/m-p/387153#M63741</link>
    <description>&lt;P&gt;You will have to clear b before appending to it (or rebuild it).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could for example set it as empty before append:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Button Box( "BE", b &amp;lt;&amp;lt; set items({}); b &amp;lt;&amp;lt; append( runScriptFilter( "BE" ) ) ),&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 20 May 2021 09:48:49 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-05-20T09:48:49Z</dc:date>
    <item>
      <title>how to remove items from list box</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-remove-items-from-list-box/m-p/387148#M63740</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;runScriptFilter = Function( {filterWord},
	{},
	If( filterWord == "FE",
		selected = {"1", "2", "3"}
	);
	If( filterWord == "SSAFI",
		selected = {"4", "5", "6"}
	);
	If( filterWord == "BE",
		selected = {"7", "8", "9"}
	);
	Return( selected );
);

//title and gui
lub1 = Lineup Box( N Col( 3 ), spacing( 5 ),
	Spacer Box( size( 0, 0 ) ),
	Spacer Box( size( 0, 0 ) ),
	Spacer Box( size( 0, 0 ) ), 
	//button and text
	Button Box( "BE", b &amp;lt;&amp;lt; append( runScriptFilter( "BE" ) ) ),
	Button Box( "SSAFI", b &amp;lt;&amp;lt; append( runScriptFilter( "SSAFI" ) ) ),
	Button Box( "FE", b &amp;lt;&amp;lt; append( runScriptFilter( "FE" ) ) ), 
	//H Center Box( text = Text Box( "Select column that will compared with indicators" ) ),
	b = List Box(),
	b &amp;lt;&amp;lt; Set height( 400 );
	b &amp;lt;&amp;lt; Set Width( 400 );
	
);
pb1 = Panel Box( "GM EOL", lub1 );
myWindow = New Window( "GM EOL", Show Menu( 0 ), show toolbars( 0 ), Border Box( Top( 20 ), Bottom( 20 ), Left( 20 ), Right( 20 ) ), pb1 );

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have a script which I simplified a little&amp;nbsp;&lt;/P&gt;&lt;P&gt;the append works great, but I want before appending a list, that it will clear the current state&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;clicking all the buttons gives me this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="itzikd_0-1621503503556.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/32979i44AC2D8347A6FFE5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="itzikd_0-1621503503556.png" alt="itzikd_0-1621503503556.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I actually want it to give me only 3 numbers and not 9 (the last button I clicked)&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:47:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-remove-items-from-list-box/m-p/387148#M63740</guid>
      <dc:creator>itzikd</dc:creator>
      <dc:date>2023-06-09T19:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove items from list box</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-remove-items-from-list-box/m-p/387153#M63741</link>
      <description>&lt;P&gt;You will have to clear b before appending to it (or rebuild it).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could for example set it as empty before append:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Button Box( "BE", b &amp;lt;&amp;lt; set items({}); b &amp;lt;&amp;lt; append( runScriptFilter( "BE" ) ) ),&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 May 2021 09:48:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-remove-items-from-list-box/m-p/387153#M63741</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-05-20T09:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove items from list box</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-remove-items-from-list-box/m-p/387166#M63742</link>
      <description>Thanks that works great!&lt;BR /&gt;Tried with delete before and it like removed the whole box so i guess i just needed to set an empty list&lt;BR /&gt;</description>
      <pubDate>Thu, 20 May 2021 10:22:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-remove-items-from-list-box/m-p/387166#M63742</guid>
      <dc:creator>itzikd</dc:creator>
      <dc:date>2021-05-20T10:22:41Z</dc:date>
    </item>
  </channel>
</rss>

