Subscribe Bookmark RSS Feed

Re: Remove all values in a numbercolbox (JMP 10)?

pmroz

Super User

Joined:

Jun 23, 2011

I'm using JMP 10 to develop some user interfaces.  I have a dialog box with some search criteria in the top section and a tablebox with stringcolboxes and numbercolboxes in the lower section.  The user enters search criteria, pushes a Refresh button, and the data in the tablebox is refreshed.  Occasionally their search yields 0 records.  When this happens the stringcolboxes clear out to no values, but the numbercolboxes don't change. 

Specifically, once I add values to a numbercolbox using << set values([1, 2, 3]), I can change the list to a different matrix e.g. << set values([4, 5, 6, 7]).  But if I want to remove all values using << set values([]), it doesn't work.

Here's an example that illustrates the problem:

nw = new window("Test",

    tablebox(

        a = stringcolbox("String Col Box", {"Hello", "World", "Fubar"}),

        b = numbercolbox("Number Col Box", [1, 2, 3])

    ),

    button box("2 Values",

        a << set values ({"AAA", "BBB"});

        b << set values([98, 99])

    ),

    button box("0 Values",

        a << set values({});

        b << set values([])

    )

);

Thanks for your help!

Regards,

Peter

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

This is indeed a bug in JMP 10 and prior versions.  It is now fixed for JMP 11.

There is an alternate message <<Set({}) which takes a list - this will work with JMP 10.

4 REPLIES
ms

Super User

Joined:

Jun 23, 2011

That's very strange. I don't see any reason why it should not work. Probably a bug.

This idea may work:

b0 = Expr( Number Col Box( "Number Col Box", [] ) );

nw = New Window( "Test",

  Table Box(

  a = String Col Box( "String Col Box",

  {"Hello", "World", "Fubar"}

  ),

  b = Number Col Box( "Number Col Box", [1, 2, 3] )

  ),

  Button Box( "2 Values",

  a << set values( {"AAA", "BBB"} );

  b << set values( [98, 99] );

  ),

  Button Box( "0 Values",

  b << delete();

  a << set values( {} ) << sib append( b = Eval( b0 ) );

  )

);

Highlighted
ms

Super User

Joined:

Jun 23, 2011

On second thought, this approach may be better and less error-prone in a more complex context:

nw = New Window( "Test",

  Table Box(

  a = String Col Box( "String Col Box", {"Hello", "World", "Fubar"} ),

  b = Number Col Box( "Number Col Box", [1, 2, 3] )

  ),

  Button Box( "2 Values",

  a << set values( {"AAA", "BBB"} );

  b << set values( [98, 99] );

  ),

  Button Box( "0 Values",

  a << set values( {} );

  For( i = N Items( b << get ), i > 0, i--,

  b << delete row( i )

  );

  )

);

Solution

This is indeed a bug in JMP 10 and prior versions.  It is now fixed for JMP 11.

There is an alternate message <<Set({}) which takes a list - this will work with JMP 10.

pmroz

Super User

Joined:

Jun 23, 2011

Thanks guys.  The command << Set({}) works perfectly!