cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
uwe_hiss
Level II

select all items in list box with button?

Hi,

does anyone know a solution to select all items in a listbox with a [All] button?


New Window( "Select ONE Monthly ", <<Modal,

V List Box(

      Text Box("ALL for Baseline"),

      mon = List Box(:Stage << get values),

      Button Box( "OK", cho = mon << get selected),

      )

);

dt_data << Select Where(Contains(cho, :Stage));


Regards and thank you in advance,

Uwe


1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: select all items in list box with button?

dt_data = Current Data Table();

mon_list = dt_data:Stage << get values;

New Window( "Select ONE Monthly ", << Modal,

     V List Box(

           Text Box( "ALL for Baseline" ),

           mon = List Box(mon_list),

           Button Box( "Select All",

                For( i = 1, i <= N Items( mon_list ), i++,

                     mon << set selected( i )

                )

           ),

           Button Box( "OK", cho = mon << get selected ),

     ),

);

dt_data << Select Where( Contains( cho, :Stage ) );

View solution in original post

6 REPLIES 6
pmroz
Super User

Re: select all items in list box with button?

dt_data = Current Data Table();

mon_list = dt_data:Stage << get values;

New Window( "Select ONE Monthly ", << Modal,

     V List Box(

           Text Box( "ALL for Baseline" ),

           mon = List Box(mon_list),

           Button Box( "Select All",

                For( i = 1, i <= N Items( mon_list ), i++,

                     mon << set selected( i )

                )

           ),

           Button Box( "OK", cho = mon << get selected ),

     ),

);

dt_data << Select Where( Contains( cho, :Stage ) );

uwe_hiss
Level II

Re: select all items in list box with button?

Thanks PMroz ... it works great :)

pmroz
Super User

Re: select all items in list box with button?

There's a bug in my code if you have duplicates in the Stage column.  A side effect of putting a list into a listbox is that it will only display unique values.

This code will fix that:

Get_unique_values = Function( {in_list}, {Default Local},

    tmp = [=> 0];

    Insert Into( tmp, in_list );

    tmp << get keys;

);

dt_data = Current Data Table();

mon_list = get_unique_values( dt_data:Stage << get values );

New Window( "Select ONE Monthly ", <<Modal,

    V List Box(

        Text Box( "ALL for Baseline" ),

        mon = List Box( mon_list ),

        Button Box( "Select All",

            For( i = 1, i <= N Items( mon_list ), i++,

                mon << set selected( i )

            )

        ),

        Button Box( "OK", cho = mon << get selected ),

    ),

);

dt_data << Select Where( Contains( cho, :Stage ) );

uwe_hiss
Level II

Re: select all items in list box with button?

Hi Peter,

Thank you for fix it, but I didn't notice this problem or bug.

I have many duplicates in the column Stage, the Listbox displays only unique values.

How can I exclude a certain value like "Baseline"?

At best case, this should not appear in the listbox.


Regards

Uwe


Update:


mon_list = dt_data:Stage << get values;

for (j = N Items (mon_list), j > 0, j--,

if (mon_list == "Baseline",remove from (mon_list, j,1))

);

pmroz
Super User

Re: select all items in list box with button?

mon_list = get_unique_values( dt_data:Stage << get values );

bindex = contains(mon_list, "Baseline");

if (bindex > 0,

     remove from(mon_list, bindex);

);

uwe_hiss
Level II

Re: select all items in list box with button?

Hi Peter,

Thank you for the solutiuon.

Unfortunately it doesn't work for me, maybe it's up to v10


Regards,

Uwe

Recommended Articles