cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
kterri3
Level I

Transferring/ updating variable values between modules.

Hello, I am scripting in JMP Pro Application Builder. 

 

  • I have a main window in which I have a button that brings me to a secondary window. Within the secondary window, there are text edit boxes where values are input by the user. Also, there is a close button on this secondary window that saves the values to the appNS and closes the secondary window.

 

  • I have the variables initialized in the main window to have default values of 0. I am having trouble getting the variables to use the updated values from the new window instead of the default values. It prints the default values instantly instead of running the function and then printing the updated values. Any help would be appreciated. 

Here are some code snippets for reference (PredictiveModeling is the main window and OptimizeModelWindow is the secondary window):

 

appNS: ParamList1 = 0;
appNS: ParamList2 = 0;
appNS: ParamList3 = 0;
appNS: ParamList4 = 0;
appNS: ParamList5 = 0;
appNS: ParamList6 = 0;
 
OptimizeParamsButtonPress = Function( {this}, // This function is called when the OptimizeParams button is pressed on the PredictiveModeling Window
name = this << Get Button Name;
OptimizeModelWindow << Create Instance(thisModuleInstance);
Wait(OptimizeModelWindow);
PList1 = appNS: ParamList1;
PList2 = appNS: ParamList2;
PList3 = appNS: ParamList3;
PList4 = appNS: ParamList4;
PList5 = appNS: ParamList5;
PList6 = appNS: ParamList6;
Print(PList1,PList2,PList3,PList4,PList5,PList6);
);
 
This is where the variables are read from the EditBoxes and update the default values...
 
doOptimizeParams = Function ( {},
HP1 = PEdit1 << Get Text;
appNS: ParamList1 = HP1;
HP2 = PEdit2 << Get Text;
appNS: ParamList2 = HP2;
HP3 = PEdit3 << Get Text;
appNS: ParamList3 = HP3;
HP4 = PEdit4 << Get Text;
appNS: ParamList4 = HP4;
HP5 = PEdit5 << Get Text;
appNS: ParamList5 = HP5;
HP6 = PEdit6 << Get Text;
appNS: ParamList6 = HP6;
);

CloseOptimizeButtonPress = Function( {this},
// This function is called when the Optimize button is pressed on the popup OptimizeModel window 
name = this << Get Button Name;
doOptimizeParams();
Print(ParamList1,ParamList2,ParamList3,ParamList4,ParamList5,ParamList6);
(thisModuleInstance << GetBox) << Close Window;
);  
2 REPLIES 2

Re: Transferring/ updating variable values between modules.

Are you creating a new window or a new application module for your dialog? They do not work the same way. See how to pass variables with application modules.

kterri3
Level I

Re: Transferring/ updating variable values between modules.

Thanks, I will look into that. I have two application modules for dialog, the primary module and the secondary module where the user inputs values. I have it working now, but maybe not the best way. I have a flag variable on the "close" button of the secondary module. When that flag is raised, I have a large "If" statement in my primary module that executes the code for this case.