Subscribe Bookmark RSS Feed

New data box()

swaiper

Community Trekker

Joined:

Apr 28, 2015

Hi,

I'm a beginner on JMP, and I want to create a dynamic app.

I have create an application and I want to display on the module the open data table.

If i create a script like that :

ds = Open( "C:\Users\rroustan\Documents\test.txt", invisible );

New Window( "Example",

H List Box( button = Button Box("test")),

H List Box( dtBox = ds << New Data Box() ));

It will work with no problem, but I want to show this table on a panel when I click on the button.

I try this :

New Window("test",

btShow = Button Box("Show table",

pTable <<Launch(

ds<<New Data Box())));

But still not working.

Someone have an idea please?

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

If you want the table in the same window as the button, try this. It creates an empty panel box (you could use a tab box, a list box, or whatever container you'd like), and appends the table when you click the button. I put in code that also looks to see if the panel box already has something in it, and deletes if it does. This allows you to later open a different data table, click the button, and replace the old table with the new one, instead of adding under the old one.

ds = Open( "$sample_import_data/Bigclass.txt", invisible );

New Window( "test",

  btShow = Button Box( "Show table",

       If(IsScriptable(pTable<<Child), (pTable<<Child)<<delete);

       pTable << Append(ds << New Data Box())

  ),

  pTable = Panel Box("Table")

);

After you run the above, run this line, to open a different table, and then click the button in the window.

ds = Open( "$sample_import_data/Animals.txt", invisible );

3 REPLIES
pmroz

Super User

Joined:

Jun 23, 2011

Your variable pTable is undefined.

The New Data Box needs to be inside a New Window to be displayed.  Try this:

New Window( "test",

     btShow = Button Box( "Show table",

           new window("Example", ds << New Data Box() )

     )

);

Solution

If you want the table in the same window as the button, try this. It creates an empty panel box (you could use a tab box, a list box, or whatever container you'd like), and appends the table when you click the button. I put in code that also looks to see if the panel box already has something in it, and deletes if it does. This allows you to later open a different data table, click the button, and replace the old table with the new one, instead of adding under the old one.

ds = Open( "$sample_import_data/Bigclass.txt", invisible );

New Window( "test",

  btShow = Button Box( "Show table",

       If(IsScriptable(pTable<<Child), (pTable<<Child)<<delete);

       pTable << Append(ds << New Data Box())

  ),

  pTable = Panel Box("Table")

);

After you run the above, run this line, to open a different table, and then click the button in the window.

ds = Open( "$sample_import_data/Animals.txt", invisible );

swaiper

Community Trekker

Joined:

Apr 28, 2015

Thank you everyone for your answers.

melaniedrake solve my porblem.