More than one script file

604
3
Jump to solution
11-05-2012 02:35 AM
Dag_MartinRomslo
New Contributor
As far as I know, it is not possible to have more than one JScript file related to an Applet file (.apa) or Layer definition file (.apl). Let's say I have a general JScript file that I want to link/reuse in many Applets together with an Applet specific JScript file. How should I solve this?
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
GustavoBediaga
New Contributor III
I don't know if I understood exactly what you want, but I will try to help you.

You can have multiple APA's working at the same time, you only have to put them in your APPLET folder.

And you can just write the Jscript code that you want to use in an ON EVENT that is related to its use. So you can have in the same layer the first script related to the APL file and the second one written in an ON EVENT, for example located in ON SET ACTIVE in the PAGE events....

hope it helps.

Gustavo

View solution in original post

0 Kudos
3 Replies
GustavoBediaga
New Contributor III
I don't know if I understood exactly what you want, but I will try to help you.

You can have multiple APA's working at the same time, you only have to put them in your APPLET folder.

And you can just write the Jscript code that you want to use in an ON EVENT that is related to its use. So you can have in the same layer the first script related to the APL file and the second one written in an ON EVENT, for example located in ON SET ACTIVE in the PAGE events....

hope it helps.

Gustavo
0 Kudos
Dag_MartinRomslo
New Contributor
I don't know if I understood exactly what you want, but I will try to help you.

You can have multiple APA's working at the same time, you only have to put them in your APPLET folder.

And you can just write the Jscript code that you want to use in an ON EVENT that is related to its use. So you can have in the same layer the first script related to the APL file and the second one written in an ON EVENT, for example located in ON SET ACTIVE in the PAGE events....

hope it helps.

Gustavo


Thank you! You put me on a track that seems to work ok.
What about returning results from methods in other scripts? This is not possible through Applets["MyApplet"].Execute("MyScript"). My solution to this is to put the result in a "global variable" in Application.UserProperties("myResult"). Is this the way to do it?
0 Kudos
GustavoBediaga
New Contributor III
Thank you! You put me on a track that seems to work ok.
What about returning results from methods in other scripts? This is not possible through Applets["MyApplet"].Execute("MyScript"). My solution to this is to put the result in a "global variable" in Application.UserProperties("myResult"). Is this the way to do it?



I don't know if it is the only way to do it, but it certain works. I have a login script, that opens a form where the user types his name, and it stores the name as a Application.UserProperties, wich is used in many others scripts and forms of my APM project...
I am having no problem with that!
Hope this works for you.

Gustavo
0 Kudos