Script to enter new row data in popup window.Hi,
I am looking to have a script produce a popup window for a user to enter data that will be added to a new row. The user only needs to add data in certain columns. I am close with the script but can't figure out how to get it to work. Added the data table with my script attempt.
Any help will be appreciated, thanks in advance!
Regards,
Chris
Automation and ScriptingRe: Script to enter new row data in popup window.I would use Data table subscripting in case like this
Names Default To Here(1);
dt = Current Data Table();
// present choices to user
nw = New Window("Add New Row Data",
<<MODAL></MODAL>
Also hints might be useful with Text Edit Boxes for you (and if you want to force users to add something there, you have to handle that also)
Names Default To Here(1);
win = New Window("Example", text = Text Edit Box(""));
text << Set Hint("Enter your name");
Re: Script to enter new row data in popup window.Here is one way to handle this
Names Default To Here( 1 );
// present choices to user
dlg = New Window( "Add New Row Data",
<<MODAL></MODAL>
Please take the time to read through the Scripting Guide. It will give you a big leg up on being able to solve such questions.
Re: Script to enter new row data in popup window.Hey Jarmo,
Just building off of this request.
Is there a way to have the Combo Box options automatically update based on List Check values in that column?
Thanks,
Chris
Re: Script to enter new row data in popup window.It is possible, but how to implement depends on your script. You can use << Get Property("List Check") to get the property from column and then get first argument of that and you should have the list of values. You can then use << Set Items to the combo box to update values.
Below is example using your original data table
Names Default To Here(1);
dt = Open("$DOWNLOADS/AddRowWindowScript.jmp");
nw = New WIndow("",
cb = Combo Box({"a", "b", "c"});
);
wait(1); // for demo purposes
lc_vals = Column(dt, "Sched/Unsch") << Get Property("List Check");
list_to_cb = Arg(lc_vals, 1);
cb << Set Items(list_to_cb);Re: Script to enter new row data in popup window.Works great, thanks!!