cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
HubP_SDe
Level III

Application Dialog ^TABLENAME reference

Dear Community,

 

I've been struggling for a while now, trying to have a Dialog ^TABLENAME reference filled in an Application Dialog Title.

It seems that it only reacts to a Current DataTable being already loaded when my app is launched.

But this is in fact the purpose of Dialog1, to chose what Data Table to open, starting from nothing:

Dialog2_Title-TABLENAME_Setting.png

 

The issue here is that even though Dialog1 script ends with opening a chosen Data Table, Dialog2 Title TABLENAME remains empty:

Dialog2_Title-TABLENAME_Render.png

 

I already tried several syntaxes at the end of Dialog1 script, with no change

OnNext1 = Function( {},
	file_path = FilePath << GetText();
	If ( file_path != "",

		//IST Text File
		dt = Open(
			file_path,
...
		);

		dt << CurrentDataTable();
		CurrentDataTable( dt );

		Dialog2 << CreateInstance( dt );
}

Any suggestion on how to push my "dt" Data Table into this ^TABLENAME reference, in a Dialog Title?

Thanks

Stéphane DELACROIX
Senior Simulation & Planning Engineer
2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Application Dialog ^TABLENAME reference

Hi Stéphane - unfortunately the ^TABLENAME substitution in Application Builder is only designed to work with the Current Data Table.  Application Builder resolves the required data tables at initialization.  One table is allowed to come from the Current Data Table at the time the Application launches, and the rest are either identified by name, by file, or are assigned dynamically by the scripts.  Data Tables are global to the Application, so there is not a table that is associated with each Module.

 

Fortunately, there is a straightforward way to set the title directly in the script for the Dialog2 module.  The window is created at the point where "thisModuleInstance << Create Objects" is called.  After that line, you can add something like:

 

(thisModuleInstance << Get Box) << Set Window Title("IST Analyser - " || (dt << Get Name));

where dt is the name of the JSL symbol for the data table, as defined in the Dialog2 module.  I hope this helps!

View solution in original post

HubP_SDe
Level III

Re: Application Dialog ^TABLENAME reference

Thanks a lot Dan,

First solving reply after more than 500 views must be close to a record!


I also found how to avoid hardcoding the app name:

(thisModuleInstance << GetBox) << SetWindowTitle( (thisApplication << GetName) || " - " || (dt2 << GetName));


It works fine as expected now.

Cheers!

Stéphane DELACROIX
Senior Simulation & Planning Engineer

View solution in original post

2 REPLIES 2

Re: Application Dialog ^TABLENAME reference

Hi Stéphane - unfortunately the ^TABLENAME substitution in Application Builder is only designed to work with the Current Data Table.  Application Builder resolves the required data tables at initialization.  One table is allowed to come from the Current Data Table at the time the Application launches, and the rest are either identified by name, by file, or are assigned dynamically by the scripts.  Data Tables are global to the Application, so there is not a table that is associated with each Module.

 

Fortunately, there is a straightforward way to set the title directly in the script for the Dialog2 module.  The window is created at the point where "thisModuleInstance << Create Objects" is called.  After that line, you can add something like:

 

(thisModuleInstance << Get Box) << Set Window Title("IST Analyser - " || (dt << Get Name));

where dt is the name of the JSL symbol for the data table, as defined in the Dialog2 module.  I hope this helps!

HubP_SDe
Level III

Re: Application Dialog ^TABLENAME reference

Thanks a lot Dan,

First solving reply after more than 500 views must be close to a record!


I also found how to avoid hardcoding the app name:

(thisModuleInstance << GetBox) << SetWindowTitle( (thisApplication << GetName) || " - " || (dt2 << GetName));


It works fine as expected now.

Cheers!

Stéphane DELACROIX
Senior Simulation & Planning Engineer