<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JSL : Define variables based on user entry through a pop up window in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-Define-variables-based-on-user-entry-through-a-pop-up-window/m-p/411145#M66064</link>
    <description>&lt;P&gt;I found the solution. I used a "Text Edit Box" and a "Get Text" for a numeric value. I modified to "Number Edit Box" and To "Get" and it works.&amp;nbsp;:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Initialize variables with default values

// Number of input data tables  (default = 1)
nb_join_tables = 2;

//links to the input HTML tables
input_table_01 = "http://xxx.html";
input_table_02 = "http://xxx.html";


//Create a pop up window to request user inputs for the variables

w = New Window( "User inputs", &amp;lt;&amp;lt;modal, // opens a window with a title and this content...
	Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing 
		V List Box( // V and H lists nest to organize the display boxes
			H Center Box( Text Box( "From html to JMP data table" ) ), // a second title, centered
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H List Box( Text Box( "Number of tables you want to merge: " ), JMP_table_nb = Number Edit Box( nb_join_tables) ), 
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H List Box( Text Box( "Insert here the .html link to the tables you want to import : " )),
			Spacer Box( size( 1, 10) ), // a little vertical space
			H List Box( Text Box( "input table 01: " ), input_table_teb01 = Text Edit Box( input_table_01) ), 
			H List Box( Text Box( "input table 02: " ), input_table_teb02 = Text Edit Box( input_table_02) ), 
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H Center Box( // center the button
				button = Button Box( "OK", // this script runs when the button is pressed...
					w &amp;lt;&amp;lt; closeWindow; // close the dialog
					nb_join_tables = JMP_table_nb &amp;lt;&amp;lt; Get ;
					input_table_01 = input_table_teb01 &amp;lt;&amp;lt; Get Text;
					input_table_02 = input_table_teb02 &amp;lt;&amp;lt; Get Text;			
				)
			)
		)
	)
);



// Name of the individual JMP data tables
JMP_table_01_name = "input01";
JMP_table_02_name = "input02";


// Create lists according to the number of tables to merge

tables_list = Eval List( {input_table_01,input_table_02} );
names_list= Eval List({JMP_table_01_name,JMP_table_01_name});
dt1={};
dt2={};
dt_list = Eval List({dt1,dt2});


For( i = 1, i &amp;lt;= nb_join_tables, i++,
		show(i, tables_list); // check the log window for the output
		//Open html data table from specific location
		dt_list[i]=Open(
			tables_list[i],
			HTML Table( 4, Column Names( 0 ), Data Starts( 1 ) )
		);
// Set JMP data table name to the desired one
		dt_list[i] &amp;lt;&amp;lt; Set Name( names_list[i] );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 Aug 2021 10:16:25 GMT</pubDate>
    <dc:creator>Starwatcher</dc:creator>
    <dc:date>2021-08-19T10:16:25Z</dc:date>
    <item>
      <title>JSL : Define variables based on user entry through a pop up window</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Define-variables-based-on-user-entry-through-a-pop-up-window/m-p/410400#M66013</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I would like to create a pop up window that allows the user to define variables without accessing the code. I managed to get the pop up to get the user entries based on previous posts, but wasn't able to pass it to the variables.&lt;/P&gt;&lt;P&gt;Could you please help me with this?&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Indicate here the name of the input HTML table
input_table = "http://xxx.html";

// Indicate here the name you want for your JMP data table
JMP_table_name = "JMP data table";


w = New Window( "User inputs", // opens a window with a title and this content...
    Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing 
        V List Box( // V and H lists nest to organize the display boxes
            H Center Box( Text Box( "Report Generator" ) ), // a second title, centered
            Spacer Box( size( 1, 30 ) ), // a little vertical space
            H List Box( Text Box( "input_table: " ), input_table=Text Edit Box("http://xxx.html") ), // data entry
            Spacer Box( size( 1, 30 ) ), // a little vertical space
            H List Box( Text Box( "JMP_table_name: " ), JMP_table_name=Text Edit Box("JMP data table") ), // more data entry
            Spacer Box( size( 1, 30 ) ), // a little vertical space
            H Center Box( // center the button
                Button Box( "Submit", // this script runs when the button is pressed...
                    input_table = result["input_table"];
					JMP_table_name = result["JMP_table_name"];
                    w &amp;lt;&amp;lt; closeWindow; // close the dialog
                )
            )
        )
    )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:54:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Define-variables-based-on-user-entry-through-a-pop-up-window/m-p/410400#M66013</guid>
      <dc:creator>Starwatcher</dc:creator>
      <dc:date>2023-06-09T19:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: JSL : Define variables based on user entry through a pop up window</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Define-variables-based-on-user-entry-through-a-pop-up-window/m-p/410411#M66014</link>
      <description>&lt;P&gt;There are a couple of issues with your script.&amp;nbsp; The first one, ir that you are changing the data type of the Input_table and the JMP_table_name variables.&amp;nbsp; You start out with then defined as character strings, but then redefine them as Display fields.&lt;/P&gt;
&lt;P&gt;Secondly, just because JMP is opening a window, does not stop the JSL processing, and wait for the user input.&amp;nbsp; JMP will just continue to process, unless the window is defined as a Modal window&amp;nbsp; See my modification of your script below.&amp;nbsp; I strongly suggest that you take the time to take the time to read the Scripting Guide.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Indicate here the name of the input HTML table
input_table = "http://xxx.html";

// Indicate here the name you want for your JMP data table
JMP_table_name = "JMP data table";


w = New Window( "User inputs", &amp;lt;&amp;lt;modal, // opens a window with a title and this content...
	Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing 
		V List Box( // V and H lists nest to organize the display boxes
			H Center Box( Text Box( "Report Generator" ) ), // a second title, centered
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H List Box( Text Box( "input_table: " ), input_table_teb = Text Edit Box( input_table ) ), // data entry
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H List Box( Text Box( "JMP_table_name: " ), JMP_table_name_teb = Text Edit Box( JMP_table_name ) ), // more data entry
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H Center Box( // center the button
				button = Button Box( "OK", // this script runs when the button is pressed...
					input_table = input_table_teb &amp;lt;&amp;lt; get text;
					JMP_table_name = JMP_table_name_teb &amp;lt;&amp;lt; get text;
					w &amp;lt;&amp;lt; closeWindow; // close the dialog
				)
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Aug 2021 09:32:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Define-variables-based-on-user-entry-through-a-pop-up-window/m-p/410411#M66014</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-08-17T09:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: JSL : Define variables based on user entry through a pop up window</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Define-variables-based-on-user-entry-through-a-pop-up-window/m-p/410440#M66017</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;Thanks also for explaining the mistakes I made; this will definitely help me through it in the future.&lt;/P&gt;&lt;P&gt;Have a good day!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 11:32:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Define-variables-based-on-user-entry-through-a-pop-up-window/m-p/410440#M66017</guid>
      <dc:creator>Starwatcher</dc:creator>
      <dc:date>2021-08-17T11:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: JSL : Define variables based on user entry through a pop up window</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Define-variables-based-on-user-entry-through-a-pop-up-window/m-p/411125#M66061</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I jumped into an additional issue.&lt;/P&gt;&lt;P&gt;I managed to get the modal window opening and passed the new variables definitions within the script for the input_table and&amp;nbsp; the JMP_table name.&lt;/P&gt;&lt;P&gt;Going on the variable I see that it was correctly updated.&lt;/P&gt;&lt;P&gt;Then, the rest of my script is supposed to perform actions, such as opening the table specified by the user (outside of the button), but it does not run.&lt;/P&gt;&lt;P&gt;I tried putting the whole script into the modal window, I tried also adding a wait() but this does not help.&lt;/P&gt;&lt;P&gt;If I run the script without the modal window it works fine, so the issue definitely comes from there.&lt;/P&gt;&lt;P&gt;Any idea how to solve this?&lt;/P&gt;&lt;P&gt;Here is the code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Initialize variables with default values

// Number of input data tables  (default = 1)
nb_join_tables = 2;

//links to the input HTML tables
input_table_01 = "http://xxx.html";
input_table_02 = "http://xxx.html";


//Create a pop up window to request user inputs for the variables

w = New Window( "User inputs", &amp;lt;&amp;lt;modal, // opens a window with a title and this content...
	Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing 
		V List Box( // V and H lists nest to organize the display boxes
			H Center Box( Text Box( "From html to JMP data table" ) ), // a second title, centered
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H List Box( Text Box( "Number of tables you want to merge: " ), JMP_table_nb = Text Edit Box( nb_join_tables) ), 
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H List Box( Text Box( "Insert here the .html link to the tables you want to import : " )),
			Spacer Box( size( 1, 10) ), // a little vertical space
			H List Box( Text Box( "input table 01: " ), input_table_teb01 = Text Edit Box( input_table_01) ), 
			H List Box( Text Box( "input table 02: " ), input_table_teb02 = Text Edit Box( input_table_02) ), 
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H Center Box( // center the button
				button = Button Box( "OK", // this script runs when the button is pressed...
					w &amp;lt;&amp;lt; closeWindow; // close the dialog
					nb_join_tables = JMP_table_nb &amp;lt;&amp;lt; Get Text;
					input_table_01 = input_table_teb01 &amp;lt;&amp;lt; Get Text;
					input_table_02 = input_table_teb02 &amp;lt;&amp;lt; Get Text;			
				)
			)
		)
	)
);


// Name of the individual JMP data tables
JMP_table_01_name = "input01";
JMP_table_02_name = "input02";


// Create lists according to the number of tables to merge

tables_list = Eval List( {input_table_01,input_table_02} );
names_list= Eval List({JMP_table_01_name,JMP_table_01_name});
dt1={};
dt2={};
dt_list = Eval List({dt1,dt2});


For( i = 1, i &amp;lt;= nb_join_tables, i++,
		show(i, tables_list); // check the log window for the output
		//Open html data table from specific location
		dt_list[i]=Open(
			tables_list[i],
			HTML Table( 4, Column Names( 0 ), Data Starts( 1 ) )
		);
// Set JMP data table name to the desired one
		dt_list[i] &amp;lt;&amp;lt; Set Name( names_list[i] );
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 08:26:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Define-variables-based-on-user-entry-through-a-pop-up-window/m-p/411125#M66061</guid>
      <dc:creator>Starwatcher</dc:creator>
      <dc:date>2021-08-19T08:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: JSL : Define variables based on user entry through a pop up window</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Define-variables-based-on-user-entry-through-a-pop-up-window/m-p/411145#M66064</link>
      <description>&lt;P&gt;I found the solution. I used a "Text Edit Box" and a "Get Text" for a numeric value. I modified to "Number Edit Box" and To "Get" and it works.&amp;nbsp;:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Initialize variables with default values

// Number of input data tables  (default = 1)
nb_join_tables = 2;

//links to the input HTML tables
input_table_01 = "http://xxx.html";
input_table_02 = "http://xxx.html";


//Create a pop up window to request user inputs for the variables

w = New Window( "User inputs", &amp;lt;&amp;lt;modal, // opens a window with a title and this content...
	Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing 
		V List Box( // V and H lists nest to organize the display boxes
			H Center Box( Text Box( "From html to JMP data table" ) ), // a second title, centered
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H List Box( Text Box( "Number of tables you want to merge: " ), JMP_table_nb = Number Edit Box( nb_join_tables) ), 
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H List Box( Text Box( "Insert here the .html link to the tables you want to import : " )),
			Spacer Box( size( 1, 10) ), // a little vertical space
			H List Box( Text Box( "input table 01: " ), input_table_teb01 = Text Edit Box( input_table_01) ), 
			H List Box( Text Box( "input table 02: " ), input_table_teb02 = Text Edit Box( input_table_02) ), 
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H Center Box( // center the button
				button = Button Box( "OK", // this script runs when the button is pressed...
					w &amp;lt;&amp;lt; closeWindow; // close the dialog
					nb_join_tables = JMP_table_nb &amp;lt;&amp;lt; Get ;
					input_table_01 = input_table_teb01 &amp;lt;&amp;lt; Get Text;
					input_table_02 = input_table_teb02 &amp;lt;&amp;lt; Get Text;			
				)
			)
		)
	)
);



// Name of the individual JMP data tables
JMP_table_01_name = "input01";
JMP_table_02_name = "input02";


// Create lists according to the number of tables to merge

tables_list = Eval List( {input_table_01,input_table_02} );
names_list= Eval List({JMP_table_01_name,JMP_table_01_name});
dt1={};
dt2={};
dt_list = Eval List({dt1,dt2});


For( i = 1, i &amp;lt;= nb_join_tables, i++,
		show(i, tables_list); // check the log window for the output
		//Open html data table from specific location
		dt_list[i]=Open(
			tables_list[i],
			HTML Table( 4, Column Names( 0 ), Data Starts( 1 ) )
		);
// Set JMP data table name to the desired one
		dt_list[i] &amp;lt;&amp;lt; Set Name( names_list[i] );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Aug 2021 10:16:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Define-variables-based-on-user-entry-through-a-pop-up-window/m-p/411145#M66064</guid>
      <dc:creator>Starwatcher</dc:creator>
      <dc:date>2021-08-19T10:16:25Z</dc:date>
    </item>
  </channel>
</rss>

