You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Hugo Ferreira <hf...@gmail.com> on 2021/10/19 00:48:36 UTC
Strangled with a new Royale wrapper component
Hi,
I'm strangled with an issue.
I'm developing a wrapper for office.js (office web add-In).
I have this file OfficeAddIn.as in src root folder with the
following content:
package
{
import org.apache.royale.events.EventDispatcher;
/**
* @externs
*/
COMPILE::JS
public class OfficeAddIn extends EventDispatcher
{
/**
* <inject_script>
* var script = document.createElement("script");
* script.setAttribute("src", "resources/office/office.js");
* document.head.appendChild(script);
* </inject_script>
*/
public function OfficeAddIn(){}
public static function writeData():void {}
}
}
At runtime when I run the writeData method from actionscript code, I get
the following error: ReferenceError: Can't find variable: OfficeAddIn
It's not my first Royale wrapper and I copied from the first one.
Thanks in advance,
Hugo.
Re: Strangled with a new Royale wrapper component
Posted by Harbs <ha...@gmail.com>.
I’m doing something similar. I have not tried an ms add-in yet, but it’s on my near-term roadmap.
What I have done is Adobe extensions/plugins. Adobe has two flavors. One (CEP) runs inside a CEF (Chromium Embedded Framework) environment. That works exactly like a normal web app and Royale runs without issues.
The second (UXP) supports web APIs, but is not a fully compliant browser environment. I got it to work both for running and debugging, but I had to jump through some hoops.
I’m not sure if any of this is applicable to you.
If you need to load some js, I’d just add it to your html template file as a script tag.
Not sure if my rambling is helpful...
> On Oct 19, 2021, at 11:17 AM, Hugo Ferreira <hf...@gmail.com> wrote:
>
> Yes, I'm loading thru localhost.
> I even have done code for debug purpose, to avoid the infamous cross domain
> issue to be able to test on localhost.
>
> It's an Web Add-In for MS Word and testing outside of localhost means that
> every single change must the uploaded to a server.
>
> I will test later load the Add-In from the server to confirm that this is
> the issue.
>
> Thank you for the tip.
>
> Maria Jose Esteve <mj...@iest.com> escreveu no dia terça, 19/10/2021
> à(s) 08:57:
>
>> Hi, It may seem silly Hugo, but... how are you running it? under the
>> website or directly accessing the html?
>> I'm doing some wrappers like you and I'm having problems with the
>> execution through localhost, it doesn't load the js. Maybe this is your
>> problem.
>>
>> Hiedra
>>
>> -----Mensaje original-----
>> De: Hugo Ferreira <hf...@gmail.com>
>> Enviado el: martes, 19 de octubre de 2021 2:49
>> Para: Apache Royale Development <de...@royale.apache.org>
>> Asunto: Strangled with a new Royale wrapper component
>>
>> Hi,
>>
>> I'm strangled with an issue.
>> I'm developing a wrapper for office.js (office web add-In).
>>
>> I have this file OfficeAddIn.as in src root folder with the following
>> content:
>>
>> package
>> {
>> import org.apache.royale.events.EventDispatcher;
>>
>> /**
>> * @externs
>> */
>> COMPILE::JS
>> public class OfficeAddIn extends EventDispatcher {
>> /**
>> * <inject_script>
>> * var script = document.createElement("script");
>> * script.setAttribute("src", "resources/office/office.js");
>> * document.head.appendChild(script);
>> * </inject_script>
>> */
>> public function OfficeAddIn(){}
>>
>> public static function writeData():void {} } }
>>
>> At runtime when I run the writeData method from actionscript code, I get
>> the following error: ReferenceError: Can't find variable: OfficeAddIn
>>
>> It's not my first Royale wrapper and I copied from the first one.
>>
>> Thanks in advance,
>> Hugo.
>>
Re: Strangled with a new Royale wrapper component
Posted by Hugo Ferreira <hf...@gmail.com>.
Yes, I'm loading thru localhost.
I even have done code for debug purpose, to avoid the infamous cross domain
issue to be able to test on localhost.
It's an Web Add-In for MS Word and testing outside of localhost means that
every single change must the uploaded to a server.
I will test later load the Add-In from the server to confirm that this is
the issue.
Thank you for the tip.
Maria Jose Esteve <mj...@iest.com> escreveu no dia terça, 19/10/2021
à(s) 08:57:
> Hi, It may seem silly Hugo, but... how are you running it? under the
> website or directly accessing the html?
> I'm doing some wrappers like you and I'm having problems with the
> execution through localhost, it doesn't load the js. Maybe this is your
> problem.
>
> Hiedra
>
> -----Mensaje original-----
> De: Hugo Ferreira <hf...@gmail.com>
> Enviado el: martes, 19 de octubre de 2021 2:49
> Para: Apache Royale Development <de...@royale.apache.org>
> Asunto: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following
> content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I get
> the following error: ReferenceError: Can't find variable: OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
RE: Strangled with a new Royale wrapper component
Posted by Maria Jose Esteve <mj...@iest.com>.
Hi, It may seem silly Hugo, but... how are you running it? under the website or directly accessing the html?
I'm doing some wrappers like you and I'm having problems with the execution through localhost, it doesn't load the js. Maybe this is your problem.
Hiedra
-----Mensaje original-----
De: Hugo Ferreira <hf...@gmail.com>
Enviado el: martes, 19 de octubre de 2021 2:49
Para: Apache Royale Development <de...@royale.apache.org>
Asunto: Strangled with a new Royale wrapper component
Hi,
I'm strangled with an issue.
I'm developing a wrapper for office.js (office web add-In).
I have this file OfficeAddIn.as in src root folder with the following content:
package
{
import org.apache.royale.events.EventDispatcher;
/**
* @externs
*/
COMPILE::JS
public class OfficeAddIn extends EventDispatcher {
/**
* <inject_script>
* var script = document.createElement("script");
* script.setAttribute("src", "resources/office/office.js");
* document.head.appendChild(script);
* </inject_script>
*/
public function OfficeAddIn(){}
public static function writeData():void {} } }
At runtime when I run the writeData method from actionscript code, I get the following error: ReferenceError: Can't find variable: OfficeAddIn
It's not my first Royale wrapper and I copied from the first one.
Thanks in advance,
Hugo.
Re: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Posted by Hugo Ferreira <hf...@gmail.com>.
Hi,
Thank you all for your suggestions !
I tested every single suggestion and came to an end of the only one
solution that works (at least until we have a better way to do).
First thing is to put:
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"
></script>
Directly on the template (yes, I don't like this solution but it's the only
way for now).
Even so, will not work for we Office Add-In.
office.js requires a initialize function and this is the only way to work:
window.onload = function()
{
Office.initialize = function () { };
}
After that, we have access to Word Add-In and I already tested and create a
table directly on the document thru Apache Royale Button :)
I have a lot of ugly tests that I need to clean up now and a lot of
office.js functions to implement.
After that I will open a github project so any one that build a office.js
with Apache Royale without effort :)
Thank you all.
Now I have a lot to do to polish this Add-In.
Maria Jose Esteve <mj...@iest.com> escreveu no dia quarta, 20/10/2021
à(s) 00:10:
> I had not read... "only for external scripts"…. how do you specify @Brian?
>
> Thx
> Hiedra
>
> De: Maria Jose Esteve <mj...@iest.com>
> Enviado el: miércoles, 20 de octubre de 2021 0:52
> Para: dev@royale.apache.org
> Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper
> component
>
>
> Hello,
>
> I wish I could get to an "end" point with this problem, although it seems
> it won't be today 😝
>
> I've read Harb's article (with some tests, none of them definitive) and
> I've added, manually, the "defer" attribute to the script where the
> dependencies are added and, to test, also to the body script where the
> App.Start() is launched but nothing seems to work for me. (It only works in
> Firefox, but before including "defer" it also worked 98% of the time)
>
> I keep getting errors when running from localhost:
>
>
> <script type="text/javascript"
> src="./library/closure/goog/base.js"></script>
> <script type="text/javascript" defer>
> // generated by Royale
> goog.addDependency('../../../App.js', ['App'],
> ['org.apache.royale.community.beads.models
>
>
> <body>
> <script type="text/javascript" defer>
> new App().start();
> </script>
>
>
>
>
> [cid:image001.png@01D7C549.CA63EDB0]
>
>
>
> @Brian, could you specify how you have implemented it in the pom?
>
>
>
> Thx.
>
>
>
> Hiedra.
>
>
>
> -----Mensaje original-----
> De: Brian Raymes <brian.raymes@teotech.com<mailto:brian.raymes@teotech.com
> >>
> Enviado el: martes, 19 de octubre de 2021 23:42
> Para: dev@royale.apache.org<ma...@royale.apache.org>
> Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper
> component
>
>
>
> What I have done to solve this issue is simply added the "defer" attribute
> to the script block for App.js (using maven-replacer-plugin with maven at
> package time).
>
>
>
> https://www.w3schools.com/tags/att_script_defer.asp
>
>
>
> "The script is downloaded in parallel to parsing the page, and executed
> after the page has finished parsing"
>
>
>
>
>
> Brian
>
>
>
> -----Original Message-----
>
> From: Yishay Weiss <yi...@apache.org>>
>
> Sent: Tuesday, October 19, 2021 3:43 AM
>
> To: dev@royale.apache.org<ma...@royale.apache.org>
>
> Subject: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
>
>
>
> > Maybe there is a way to make App.start() wait until all the js are
> loaded?
>
>
>
> FWIW, this has already been discussed [1] extensively. I think the
> conclusion was that in most cases loading order will not be so so
> important, unless a JS lib is called right at the start. The easiest
> workaround for now I think is to time the methods calls carefully, e.g.
> after a user click.
>
>
>
> [1]
> https://lists.apache.org/thread.html/r2f2d8f68936f9bbf061a80a8ff996bc0398e74c6349ad6e28402d4d0%40%3Cdev.royale.apache.org%3E
>
>
>
> On 2021/10/19 10:18:03, Maria Jose Esteve <mjesteve@iest.com<mailto:
> mjesteve@iest.com>> wrote:
>
> > Exactly, that's what happens to me when I launch against localhost, the
> js hasn't loaded yet but I don't know how to fix it. I tried monitoring the
> network and I see it loads but App loads before.... In theory the scripts
> inside the "body" shouldn't they run after all the js have loaded?
>
> > I've tried to force it, with a custom loader in js but nothing worked,
>
> > probably because I'm not doing it correctly :( Maybe there is a way to
> make App.start() wait until all the js are loaded?
>
> >
>
> > Hiedra
>
> >
>
> > -----Mensaje original-----
>
> > De: Yishay Weiss <yi...@hotmail.com>>
> Enviado el: martes, 19 de
>
> > octubre de 2021 12:05
>
> > Para: dev@royale.apache.org<ma...@royale.apache.org>
>
> > Asunto: RE: Strangled with a new Royale wrapper component
>
> >
>
> > *method later
>
> >
>
> > From: Yishay Weiss<ma...@hotmail.com>
>
> > Sent: Tuesday, October 19, 2021 1:04 PM
>
> > To: dev@royale.apache.org<mailto:dev@royale.apache.org<mailto:
> dev@royale.apache.org%3cmailto:dev@royale.apache.org>>
>
> > Subject: RE: Strangled with a new Royale wrapper component
>
> >
>
> > Are you sure "resources/office/office.js" is being loaded in time? IIRC
> you can look in the html elements panel and look for the <script> element.
> Also, keep in mind that loading a script is an async operation so maybe
> calling the method layer will help?
>
> >
>
> > Just some quick thoughts.
>
> >
>
> >
>
> >
>
> > From: Hugo Ferreira<ma...@gmail.com>
>
> > Sent: Tuesday, October 19, 2021 3:48 AM
>
> > To: Apache Royale Development<ma...@royale.apache.org>
>
> > Subject: Strangled with a new Royale wrapper component
>
> >
>
> > Hi,
>
> >
>
> > I'm strangled with an issue.
>
> > I'm developing a wrapper for office.js (office web add-In).
>
> >
>
> > I have this file OfficeAddIn.as in src root folder with the following
> content:
>
> >
>
> > package
>
> > {
>
> > import org.apache.royale.events.EventDispatcher;
>
> >
>
> > /**
>
> > * @externs
>
> > */
>
> > COMPILE::JS
>
> > public class OfficeAddIn extends EventDispatcher {
>
> > /**
>
> > * <inject_script>
>
> > * var script = document.createElement("script");
>
> > * script.setAttribute("src", "resources/office/office.js");
>
> > * document.head.appendChild(script);
>
> > * </inject_script>
>
> > */
>
> > public function OfficeAddIn(){}
>
> >
>
> > public static function writeData():void {} } }
>
> >
>
> > At runtime when I run the writeData method from actionscript code, I
>
> > get the following error: ReferenceError: Can't find variable:
>
> > OfficeAddIn
>
> >
>
> > It's not my first Royale wrapper and I copied from the first one.
>
> >
>
> > Thanks in advance,
>
> > Hugo.
>
> >
>
> >
>
> >
>
RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Posted by Brian Raymes <br...@teotech.com>.
Feel free to disregard the timestamp stuff. That is my attempt at defeating the browser caches.
I have this plugin for development:
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<ignoreMissingFile>false</ignoreMissingFile>
<file>${basedir}/target/javascript/bin/js-debug/index.html</file>
<replacements>
<replacement>
<token>
<![CDATA[((goog\.addDependency)(.)*)(\.js)]]>
</token>
<value>
<![CDATA[$1.js?v=${timestamp}]]>
</value>
</replacement>
<replacement>
<token>
<![CDATA[App.css]]>
</token>
<value>
<![CDATA[App.css?v=${timestamp}]]>
</value>
</replacement>
<replacement>
<token>
<![CDATA[<script type="text\/javascript">\n\/\/ generated by Royale]]>
</token>
<value>
<![CDATA[<script type="text\/javascript" defer>\/\/ generated by Royale]]>
</value>
</replacement>
</replacements>
</configuration>
</plugin>
And this setup for release:
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<ignoreMissingFile>false</ignoreMissingFile>
<file>${compiler.output-dir}/index.html</file>
<replacements>
<replacement>
<token>
<![CDATA[<script type="text/javascript" src="./App.js"></script>]]>
</token>
<value>
<![CDATA[<script defer type="text/javascript" src="./App.js?v=${timestamp}"></script>]]>
</value>
</replacement>
<replacement>
<token>
<![CDATA[<link rel="stylesheet" type="text/css" href="App.min.css">]]>
</token>
<value>
<![CDATA[<link rel="stylesheet" type="text/css" href="App.min.css?v=${timestamp}">]]>
</value>
</replacement>
<replacement>
<token>
<![CDATA[<link rel="stylesheet" type="text/css" href="./assets/css/defaults.css">]]>
</token>
<value>
<![CDATA[<link rel="stylesheet" type="text/css" href="./assets/css/defaults.css?v=${timestamp}">]]>
</value>
</replacement>
</replacements>
</configuration>
</plugin>
-----Original Message-----
From: Maria Jose Esteve <mj...@iest.com>
Sent: Wednesday, October 20, 2021 1:09 PM
To: dev@royale.apache.org
Subject: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
First I tried it only in this script and then I added it to the body script "to test" but it didn't work either.
Can you pass me the text you put in the pom to replace?
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com> Enviado el: miércoles, 20 de octubre de 2021 20:44
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
I do not see anything wrong with what you just provided. Same as what I have been using.
In the previous email, it looks like you may have added it to the "new App().start();" as well?
-----Original Message-----
From: Maria Jose Esteve <mj...@iest.com>
Sent: Wednesday, October 20, 2021 11:19 AM
To: dev@royale.apache.org
Subject: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Hi,
Yes, I understand the parameters... Well, I must be doing something wrong...
If I assign "manually" the defer ... It doesn't work for me:
...
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
...
See anything wrong?
Thx
Hiedra
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com> Enviado el: miércoles, 20 de octubre de 2021 19:01
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
I have only added a single defer, specifically this one (as well as in the release version):
<script type="text/javascript" defer>
// generated by Royale
That should force all other (external, and other) scripts to load first, leaving the Royale app as the final load.
When you think about the order of operations, we want external and other scripts to load before the Royale script is parsed (before we even ask it to start).
Hope that helps.
-----Original Message-----
From: Maria Jose Esteve <mj...@iest.com>
Sent: Tuesday, October 19, 2021 4:10 PM
To: dev@royale.apache.org
Subject: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
I had not read... "only for external scripts"…. how do you specify @Brian?
Thx
Hiedra
De: Maria Jose Esteve <mj...@iest.com> Enviado el: miércoles, 20 de octubre de 2021 0:52
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Hello,
I wish I could get to an "end" point with this problem, although it seems it won't be today 😝
I've read Harb's article (with some tests, none of them definitive) and I've added, manually, the "defer" attribute to the script where the dependencies are added and, to test, also to the body script where the App.Start() is launched but nothing seems to work for me. (It only works in Firefox, but before including "defer" it also worked 98% of the time)
I keep getting errors when running from localhost:
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
<body>
<script type="text/javascript" defer>
new App().start();
</script>
[cid:image001.png@01D7C549.CA63EDB0]
@Brian, could you specify how you have implemented it in the pom?
Thx.
Hiedra.
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com>>
Enviado el: martes, 19 de octubre de 2021 23:42
Para: dev@royale.apache.org<ma...@royale.apache.org>
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
What I have done to solve this issue is simply added the "defer" attribute to the script block for App.js (using maven-replacer-plugin with maven at package time).
https://www.w3schools.com/tags/att_script_defer.asp
"The script is downloaded in parallel to parsing the page, and executed after the page has finished parsing"
Brian
-----Original Message-----
From: Yishay Weiss <yi...@apache.org>>
Sent: Tuesday, October 19, 2021 3:43 AM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
> Maybe there is a way to make App.start() wait until all the js are loaded?
FWIW, this has already been discussed [1] extensively. I think the conclusion was that in most cases loading order will not be so so important, unless a JS lib is called right at the start. The easiest workaround for now I think is to time the methods calls carefully, e.g. after a user click.
[1] https://lists.apache.org/thread.html/r2f2d8f68936f9bbf061a80a8ff996bc0398e74c6349ad6e28402d4d0%40%3Cdev.royale.apache.org%3E
On 2021/10/19 10:18:03, Maria Jose Esteve <mj...@iest.com>> wrote:
> Exactly, that's what happens to me when I launch against localhost, the js hasn't loaded yet but I don't know how to fix it. I tried monitoring the network and I see it loads but App loads before.... In theory the scripts inside the "body" shouldn't they run after all the js have loaded?
> I've tried to force it, with a custom loader in js but nothing worked,
> probably because I'm not doing it correctly :( Maybe there is a way to make App.start() wait until all the js are loaded?
>
> Hiedra
>
> -----Mensaje original-----
> De: Yishay Weiss
> <yi...@hotmail.com>> Enviado el:
> martes, 19 de
> octubre de 2021 12:05
> Para: dev@royale.apache.org<ma...@royale.apache.org>
> Asunto: RE: Strangled with a new Royale wrapper component
>
> *method later
>
> From: Yishay Weiss<ma...@hotmail.com>
> Sent: Tuesday, October 19, 2021 1:04 PM
> To:
> dev@royale.apache.org<mailto:dev@royale.apache.org<mailto:dev@royale.a
> pache.org%3cmailto:dev@royale.apache.org>>
> Subject: RE: Strangled with a new Royale wrapper component
>
> Are you sure "resources/office/office.js" is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
>
> Just some quick thoughts.
>
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Tuesday, October 19, 2021 3:48 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I
> get the following error: ReferenceError: Can't find variable:
> OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
>
>
RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Posted by Maria Jose Esteve <mj...@iest.com>.
First I tried it only in this script and then I added it to the body script "to test" but it didn't work either.
Can you pass me the text you put in the pom to replace?
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com>
Enviado el: miércoles, 20 de octubre de 2021 20:44
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
I do not see anything wrong with what you just provided. Same as what I have been using.
In the previous email, it looks like you may have added it to the "new App().start();" as well?
-----Original Message-----
From: Maria Jose Esteve <mj...@iest.com>
Sent: Wednesday, October 20, 2021 11:19 AM
To: dev@royale.apache.org
Subject: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Hi,
Yes, I understand the parameters... Well, I must be doing something wrong...
If I assign "manually" the defer ... It doesn't work for me:
...
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
...
See anything wrong?
Thx
Hiedra
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com> Enviado el: miércoles, 20 de octubre de 2021 19:01
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
I have only added a single defer, specifically this one (as well as in the release version):
<script type="text/javascript" defer>
// generated by Royale
That should force all other (external, and other) scripts to load first, leaving the Royale app as the final load.
When you think about the order of operations, we want external and other scripts to load before the Royale script is parsed (before we even ask it to start).
Hope that helps.
-----Original Message-----
From: Maria Jose Esteve <mj...@iest.com>
Sent: Tuesday, October 19, 2021 4:10 PM
To: dev@royale.apache.org
Subject: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
I had not read... "only for external scripts"…. how do you specify @Brian?
Thx
Hiedra
De: Maria Jose Esteve <mj...@iest.com> Enviado el: miércoles, 20 de octubre de 2021 0:52
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Hello,
I wish I could get to an "end" point with this problem, although it seems it won't be today 😝
I've read Harb's article (with some tests, none of them definitive) and I've added, manually, the "defer" attribute to the script where the dependencies are added and, to test, also to the body script where the App.Start() is launched but nothing seems to work for me. (It only works in Firefox, but before including "defer" it also worked 98% of the time)
I keep getting errors when running from localhost:
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
<body>
<script type="text/javascript" defer>
new App().start();
</script>
[cid:image001.png@01D7C549.CA63EDB0]
@Brian, could you specify how you have implemented it in the pom?
Thx.
Hiedra.
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com>>
Enviado el: martes, 19 de octubre de 2021 23:42
Para: dev@royale.apache.org<ma...@royale.apache.org>
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
What I have done to solve this issue is simply added the "defer" attribute to the script block for App.js (using maven-replacer-plugin with maven at package time).
https://www.w3schools.com/tags/att_script_defer.asp
"The script is downloaded in parallel to parsing the page, and executed after the page has finished parsing"
Brian
-----Original Message-----
From: Yishay Weiss <yi...@apache.org>>
Sent: Tuesday, October 19, 2021 3:43 AM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
> Maybe there is a way to make App.start() wait until all the js are loaded?
FWIW, this has already been discussed [1] extensively. I think the conclusion was that in most cases loading order will not be so so important, unless a JS lib is called right at the start. The easiest workaround for now I think is to time the methods calls carefully, e.g. after a user click.
[1] https://lists.apache.org/thread.html/r2f2d8f68936f9bbf061a80a8ff996bc0398e74c6349ad6e28402d4d0%40%3Cdev.royale.apache.org%3E
On 2021/10/19 10:18:03, Maria Jose Esteve <mj...@iest.com>> wrote:
> Exactly, that's what happens to me when I launch against localhost, the js hasn't loaded yet but I don't know how to fix it. I tried monitoring the network and I see it loads but App loads before.... In theory the scripts inside the "body" shouldn't they run after all the js have loaded?
> I've tried to force it, with a custom loader in js but nothing worked,
> probably because I'm not doing it correctly :( Maybe there is a way to make App.start() wait until all the js are loaded?
>
> Hiedra
>
> -----Mensaje original-----
> De: Yishay Weiss
> <yi...@hotmail.com>> Enviado el:
> martes, 19 de
> octubre de 2021 12:05
> Para: dev@royale.apache.org<ma...@royale.apache.org>
> Asunto: RE: Strangled with a new Royale wrapper component
>
> *method later
>
> From: Yishay Weiss<ma...@hotmail.com>
> Sent: Tuesday, October 19, 2021 1:04 PM
> To:
> dev@royale.apache.org<mailto:dev@royale.apache.org<mailto:dev@royale.a
> pache.org%3cmailto:dev@royale.apache.org>>
> Subject: RE: Strangled with a new Royale wrapper component
>
> Are you sure "resources/office/office.js" is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
>
> Just some quick thoughts.
>
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Tuesday, October 19, 2021 3:48 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I
> get the following error: ReferenceError: Can't find variable:
> OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
>
>
RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Posted by Brian Raymes <br...@teotech.com>.
I do not see anything wrong with what you just provided. Same as what I have been using.
In the previous email, it looks like you may have added it to the "new App().start();" as well?
-----Original Message-----
From: Maria Jose Esteve <mj...@iest.com>
Sent: Wednesday, October 20, 2021 11:19 AM
To: dev@royale.apache.org
Subject: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Hi,
Yes, I understand the parameters... Well, I must be doing something wrong...
If I assign "manually" the defer ... It doesn't work for me:
...
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
...
See anything wrong?
Thx
Hiedra
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com> Enviado el: miércoles, 20 de octubre de 2021 19:01
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
I have only added a single defer, specifically this one (as well as in the release version):
<script type="text/javascript" defer>
// generated by Royale
That should force all other (external, and other) scripts to load first, leaving the Royale app as the final load.
When you think about the order of operations, we want external and other scripts to load before the Royale script is parsed (before we even ask it to start).
Hope that helps.
-----Original Message-----
From: Maria Jose Esteve <mj...@iest.com>
Sent: Tuesday, October 19, 2021 4:10 PM
To: dev@royale.apache.org
Subject: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
I had not read... "only for external scripts"…. how do you specify @Brian?
Thx
Hiedra
De: Maria Jose Esteve <mj...@iest.com> Enviado el: miércoles, 20 de octubre de 2021 0:52
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Hello,
I wish I could get to an "end" point with this problem, although it seems it won't be today 😝
I've read Harb's article (with some tests, none of them definitive) and I've added, manually, the "defer" attribute to the script where the dependencies are added and, to test, also to the body script where the App.Start() is launched but nothing seems to work for me. (It only works in Firefox, but before including "defer" it also worked 98% of the time)
I keep getting errors when running from localhost:
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
<body>
<script type="text/javascript" defer>
new App().start();
</script>
[cid:image001.png@01D7C549.CA63EDB0]
@Brian, could you specify how you have implemented it in the pom?
Thx.
Hiedra.
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com>>
Enviado el: martes, 19 de octubre de 2021 23:42
Para: dev@royale.apache.org<ma...@royale.apache.org>
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
What I have done to solve this issue is simply added the "defer" attribute to the script block for App.js (using maven-replacer-plugin with maven at package time).
https://www.w3schools.com/tags/att_script_defer.asp
"The script is downloaded in parallel to parsing the page, and executed after the page has finished parsing"
Brian
-----Original Message-----
From: Yishay Weiss <yi...@apache.org>>
Sent: Tuesday, October 19, 2021 3:43 AM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
> Maybe there is a way to make App.start() wait until all the js are loaded?
FWIW, this has already been discussed [1] extensively. I think the conclusion was that in most cases loading order will not be so so important, unless a JS lib is called right at the start. The easiest workaround for now I think is to time the methods calls carefully, e.g. after a user click.
[1] https://lists.apache.org/thread.html/r2f2d8f68936f9bbf061a80a8ff996bc0398e74c6349ad6e28402d4d0%40%3Cdev.royale.apache.org%3E
On 2021/10/19 10:18:03, Maria Jose Esteve <mj...@iest.com>> wrote:
> Exactly, that's what happens to me when I launch against localhost, the js hasn't loaded yet but I don't know how to fix it. I tried monitoring the network and I see it loads but App loads before.... In theory the scripts inside the "body" shouldn't they run after all the js have loaded?
> I've tried to force it, with a custom loader in js but nothing worked,
> probably because I'm not doing it correctly :( Maybe there is a way to make App.start() wait until all the js are loaded?
>
> Hiedra
>
> -----Mensaje original-----
> De: Yishay Weiss
> <yi...@hotmail.com>> Enviado el:
> martes, 19 de
> octubre de 2021 12:05
> Para: dev@royale.apache.org<ma...@royale.apache.org>
> Asunto: RE: Strangled with a new Royale wrapper component
>
> *method later
>
> From: Yishay Weiss<ma...@hotmail.com>
> Sent: Tuesday, October 19, 2021 1:04 PM
> To:
> dev@royale.apache.org<mailto:dev@royale.apache.org<mailto:dev@royale.a
> pache.org%3cmailto:dev@royale.apache.org>>
> Subject: RE: Strangled with a new Royale wrapper component
>
> Are you sure "resources/office/office.js" is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
>
> Just some quick thoughts.
>
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Tuesday, October 19, 2021 3:48 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I
> get the following error: ReferenceError: Can't find variable:
> OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
>
>
RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Posted by Maria Jose Esteve <mj...@iest.com>.
Hi,
Yes, I understand the parameters... Well, I must be doing something wrong...
If I assign "manually" the defer ... It doesn't work for me:
...
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
...
See anything wrong?
Thx
Hiedra
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com>
Enviado el: miércoles, 20 de octubre de 2021 19:01
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
I have only added a single defer, specifically this one (as well as in the release version):
<script type="text/javascript" defer>
// generated by Royale
That should force all other (external, and other) scripts to load first, leaving the Royale app as the final load.
When you think about the order of operations, we want external and other scripts to load before the Royale script is parsed (before we even ask it to start).
Hope that helps.
-----Original Message-----
From: Maria Jose Esteve <mj...@iest.com>
Sent: Tuesday, October 19, 2021 4:10 PM
To: dev@royale.apache.org
Subject: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
I had not read... "only for external scripts"…. how do you specify @Brian?
Thx
Hiedra
De: Maria Jose Esteve <mj...@iest.com> Enviado el: miércoles, 20 de octubre de 2021 0:52
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Hello,
I wish I could get to an "end" point with this problem, although it seems it won't be today 😝
I've read Harb's article (with some tests, none of them definitive) and I've added, manually, the "defer" attribute to the script where the dependencies are added and, to test, also to the body script where the App.Start() is launched but nothing seems to work for me. (It only works in Firefox, but before including "defer" it also worked 98% of the time)
I keep getting errors when running from localhost:
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
<body>
<script type="text/javascript" defer>
new App().start();
</script>
[cid:image001.png@01D7C549.CA63EDB0]
@Brian, could you specify how you have implemented it in the pom?
Thx.
Hiedra.
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com>>
Enviado el: martes, 19 de octubre de 2021 23:42
Para: dev@royale.apache.org<ma...@royale.apache.org>
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
What I have done to solve this issue is simply added the "defer" attribute to the script block for App.js (using maven-replacer-plugin with maven at package time).
https://www.w3schools.com/tags/att_script_defer.asp
"The script is downloaded in parallel to parsing the page, and executed after the page has finished parsing"
Brian
-----Original Message-----
From: Yishay Weiss <yi...@apache.org>>
Sent: Tuesday, October 19, 2021 3:43 AM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
> Maybe there is a way to make App.start() wait until all the js are loaded?
FWIW, this has already been discussed [1] extensively. I think the conclusion was that in most cases loading order will not be so so important, unless a JS lib is called right at the start. The easiest workaround for now I think is to time the methods calls carefully, e.g. after a user click.
[1] https://lists.apache.org/thread.html/r2f2d8f68936f9bbf061a80a8ff996bc0398e74c6349ad6e28402d4d0%40%3Cdev.royale.apache.org%3E
On 2021/10/19 10:18:03, Maria Jose Esteve <mj...@iest.com>> wrote:
> Exactly, that's what happens to me when I launch against localhost, the js hasn't loaded yet but I don't know how to fix it. I tried monitoring the network and I see it loads but App loads before.... In theory the scripts inside the "body" shouldn't they run after all the js have loaded?
> I've tried to force it, with a custom loader in js but nothing worked,
> probably because I'm not doing it correctly :( Maybe there is a way to make App.start() wait until all the js are loaded?
>
> Hiedra
>
> -----Mensaje original-----
> De: Yishay Weiss
> <yi...@hotmail.com>> Enviado el:
> martes, 19 de
> octubre de 2021 12:05
> Para: dev@royale.apache.org<ma...@royale.apache.org>
> Asunto: RE: Strangled with a new Royale wrapper component
>
> *method later
>
> From: Yishay Weiss<ma...@hotmail.com>
> Sent: Tuesday, October 19, 2021 1:04 PM
> To:
> dev@royale.apache.org<mailto:dev@royale.apache.org<mailto:dev@royale.a
> pache.org%3cmailto:dev@royale.apache.org>>
> Subject: RE: Strangled with a new Royale wrapper component
>
> Are you sure "resources/office/office.js" is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
>
> Just some quick thoughts.
>
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Tuesday, October 19, 2021 3:48 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I
> get the following error: ReferenceError: Can't find variable:
> OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
>
>
RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Posted by Brian Raymes <br...@teotech.com>.
I have only added a single defer, specifically this one (as well as in the release version):
<script type="text/javascript" defer>
// generated by Royale
That should force all other (external, and other) scripts to load first, leaving the Royale app as the final load.
When you think about the order of operations, we want external and other scripts to load before the Royale script is parsed (before we even ask it to start).
Hope that helps.
-----Original Message-----
From: Maria Jose Esteve <mj...@iest.com>
Sent: Tuesday, October 19, 2021 4:10 PM
To: dev@royale.apache.org
Subject: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
I had not read... "only for external scripts"…. how do you specify @Brian?
Thx
Hiedra
De: Maria Jose Esteve <mj...@iest.com> Enviado el: miércoles, 20 de octubre de 2021 0:52
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Hello,
I wish I could get to an "end" point with this problem, although it seems it won't be today 😝
I've read Harb's article (with some tests, none of them definitive) and I've added, manually, the "defer" attribute to the script where the dependencies are added and, to test, also to the body script where the App.Start() is launched but nothing seems to work for me. (It only works in Firefox, but before including "defer" it also worked 98% of the time)
I keep getting errors when running from localhost:
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
<body>
<script type="text/javascript" defer>
new App().start();
</script>
[cid:image001.png@01D7C549.CA63EDB0]
@Brian, could you specify how you have implemented it in the pom?
Thx.
Hiedra.
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com>>
Enviado el: martes, 19 de octubre de 2021 23:42
Para: dev@royale.apache.org<ma...@royale.apache.org>
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
What I have done to solve this issue is simply added the "defer" attribute to the script block for App.js (using maven-replacer-plugin with maven at package time).
https://www.w3schools.com/tags/att_script_defer.asp
"The script is downloaded in parallel to parsing the page, and executed after the page has finished parsing"
Brian
-----Original Message-----
From: Yishay Weiss <yi...@apache.org>>
Sent: Tuesday, October 19, 2021 3:43 AM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
> Maybe there is a way to make App.start() wait until all the js are loaded?
FWIW, this has already been discussed [1] extensively. I think the conclusion was that in most cases loading order will not be so so important, unless a JS lib is called right at the start. The easiest workaround for now I think is to time the methods calls carefully, e.g. after a user click.
[1] https://lists.apache.org/thread.html/r2f2d8f68936f9bbf061a80a8ff996bc0398e74c6349ad6e28402d4d0%40%3Cdev.royale.apache.org%3E
On 2021/10/19 10:18:03, Maria Jose Esteve <mj...@iest.com>> wrote:
> Exactly, that's what happens to me when I launch against localhost, the js hasn't loaded yet but I don't know how to fix it. I tried monitoring the network and I see it loads but App loads before.... In theory the scripts inside the "body" shouldn't they run after all the js have loaded?
> I've tried to force it, with a custom loader in js but nothing worked,
> probably because I'm not doing it correctly :( Maybe there is a way to make App.start() wait until all the js are loaded?
>
> Hiedra
>
> -----Mensaje original-----
> De: Yishay Weiss
> <yi...@hotmail.com>> Enviado el:
> martes, 19 de
> octubre de 2021 12:05
> Para: dev@royale.apache.org<ma...@royale.apache.org>
> Asunto: RE: Strangled with a new Royale wrapper component
>
> *method later
>
> From: Yishay Weiss<ma...@hotmail.com>
> Sent: Tuesday, October 19, 2021 1:04 PM
> To:
> dev@royale.apache.org<mailto:dev@royale.apache.org<mailto:dev@royale.a
> pache.org%3cmailto:dev@royale.apache.org>>
> Subject: RE: Strangled with a new Royale wrapper component
>
> Are you sure "resources/office/office.js" is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
>
> Just some quick thoughts.
>
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Tuesday, October 19, 2021 3:48 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I
> get the following error: ReferenceError: Can't find variable:
> OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
>
>
RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Posted by Maria Jose Esteve <mj...@iest.com>.
I had not read... "only for external scripts"…. how do you specify @Brian?
Thx
Hiedra
De: Maria Jose Esteve <mj...@iest.com>
Enviado el: miércoles, 20 de octubre de 2021 0:52
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Hello,
I wish I could get to an "end" point with this problem, although it seems it won't be today 😝
I've read Harb's article (with some tests, none of them definitive) and I've added, manually, the "defer" attribute to the script where the dependencies are added and, to test, also to the body script where the App.Start() is launched but nothing seems to work for me. (It only works in Firefox, but before including "defer" it also worked 98% of the time)
I keep getting errors when running from localhost:
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
<body>
<script type="text/javascript" defer>
new App().start();
</script>
[cid:image001.png@01D7C549.CA63EDB0]
@Brian, could you specify how you have implemented it in the pom?
Thx.
Hiedra.
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com>>
Enviado el: martes, 19 de octubre de 2021 23:42
Para: dev@royale.apache.org<ma...@royale.apache.org>
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
What I have done to solve this issue is simply added the "defer" attribute to the script block for App.js (using maven-replacer-plugin with maven at package time).
https://www.w3schools.com/tags/att_script_defer.asp
"The script is downloaded in parallel to parsing the page, and executed after the page has finished parsing"
Brian
-----Original Message-----
From: Yishay Weiss <yi...@apache.org>>
Sent: Tuesday, October 19, 2021 3:43 AM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
> Maybe there is a way to make App.start() wait until all the js are loaded?
FWIW, this has already been discussed [1] extensively. I think the conclusion was that in most cases loading order will not be so so important, unless a JS lib is called right at the start. The easiest workaround for now I think is to time the methods calls carefully, e.g. after a user click.
[1] https://lists.apache.org/thread.html/r2f2d8f68936f9bbf061a80a8ff996bc0398e74c6349ad6e28402d4d0%40%3Cdev.royale.apache.org%3E
On 2021/10/19 10:18:03, Maria Jose Esteve <mj...@iest.com>> wrote:
> Exactly, that's what happens to me when I launch against localhost, the js hasn't loaded yet but I don't know how to fix it. I tried monitoring the network and I see it loads but App loads before.... In theory the scripts inside the "body" shouldn't they run after all the js have loaded?
> I've tried to force it, with a custom loader in js but nothing worked,
> probably because I'm not doing it correctly :( Maybe there is a way to make App.start() wait until all the js are loaded?
>
> Hiedra
>
> -----Mensaje original-----
> De: Yishay Weiss <yi...@hotmail.com>> Enviado el: martes, 19 de
> octubre de 2021 12:05
> Para: dev@royale.apache.org<ma...@royale.apache.org>
> Asunto: RE: Strangled with a new Royale wrapper component
>
> *method later
>
> From: Yishay Weiss<ma...@hotmail.com>
> Sent: Tuesday, October 19, 2021 1:04 PM
> To: dev@royale.apache.org<ma...@royale.apache.org>>
> Subject: RE: Strangled with a new Royale wrapper component
>
> Are you sure "resources/office/office.js" is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
>
> Just some quick thoughts.
>
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Tuesday, October 19, 2021 3:48 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I
> get the following error: ReferenceError: Can't find variable:
> OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
>
>
RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Posted by Maria Jose Esteve <mj...@iest.com>.
Sorry, the image error…
Se produjo una excepción: ReferenceError: VirtualSelect is not defined
*
at org.apache.royale.community.views.virtualselect.VirtualSelectJSAS.makeVList (http://localhost:8080/royale.community.example.debug/org/apache/royale/community/views/virtualselect/VirtualSelectJSAS.js:309:87) at org.apache.royale.community.views.virtualselect.VirtualSelectJS.org_apache_royale_community_views_virtualselect_VirtualSelectJS_makeVList (http://localhost:8080/royale.community.example.debug/org/apache/royale/community/views/virtualselect/VirtualSelectJS.js:228:13) at org.apache.royale.community.views.virtualselect.VirtualSelectJS.onInitComplete (http://localhost:8080/royale.community.example.debug/org/apache/royale/community/views/virtualselect/VirtualSelectJS.js:148:8) at org.apache.royale.community.views.virtualselect.VirtualSelectJS.$EH_13_0 (http://localhost:8080/royale.community.example.debug/org/apache/royale/community/views/virtualselect/VirtualSelectJS.js:304:8) at org.apache.royale.community.views.virtualselect.VirtualSelectJS.org.apache.royale.events.EventDispatcher.fireListeners (http://localhost:8080/royale.community.example.debug/org/apache/royale/events/EventDispatcher.js:97:23) at Function.goog.events.EventTarget.dispatchEventInternal_ (http://localhost:8080/royale.community.example.debug/library/closure/goog/events/eventtarget.js:381:26) at org.apache.royale.community.views.virtualselect.VirtualSelectJS.org.apache.royale.events.EventDispatcher.dispatchEvent (http://localhost:8080/royale.community.example.debug/org/apache/royale/events/EventDispatcher.js:72:37) at org.apache.royale.community.views.virtualselect.VirtualSelectJS.org.apache.royale.core.ElementWrapper.dispatchEvent (http://localhost:8080/royale.community.example.debug/org/apache/royale/core/ElementWrapper.js:231:76) at org.apache.royale.community.views.virtualselect.VirtualSelectJS.org.apache.royale.jewel.Container.addedToParent (http://localhost:8080/royale.community.example.debug/org/apache/royale/jewel/Container.js:71:10) at org.apache.royale.jewel.ScrollableSectionContent.org.apache.royale.core.UIBase.addElement (http://localhost:8080/royale.community.example.debug/org/apache/royale/core/UIBase.js:397:5)
De: Maria Jose Esteve <mj...@iest.com>
Enviado el: miércoles, 20 de octubre de 2021 0:52
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Hello,
I wish I could get to an "end" point with this problem, although it seems it won't be today 😝
I've read Harb's article (with some tests, none of them definitive) and I've added, manually, the "defer" attribute to the script where the dependencies are added and, to test, also to the body script where the App.Start() is launched but nothing seems to work for me. (It only works in Firefox, but before including "defer" it also worked 98% of the time)
I keep getting errors when running from localhost:
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
<body>
<script type="text/javascript" defer>
new App().start();
</script>
[cid:image001.png@01D7C549.CA63EDB0]
@Brian, could you specify how you have implemented it in the pom?
Thx.
Hiedra.
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com>>
Enviado el: martes, 19 de octubre de 2021 23:42
Para: dev@royale.apache.org<ma...@royale.apache.org>
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
What I have done to solve this issue is simply added the "defer" attribute to the script block for App.js (using maven-replacer-plugin with maven at package time).
https://www.w3schools.com/tags/att_script_defer.asp
"The script is downloaded in parallel to parsing the page, and executed after the page has finished parsing"
Brian
-----Original Message-----
From: Yishay Weiss <yi...@apache.org>>
Sent: Tuesday, October 19, 2021 3:43 AM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
> Maybe there is a way to make App.start() wait until all the js are loaded?
FWIW, this has already been discussed [1] extensively. I think the conclusion was that in most cases loading order will not be so so important, unless a JS lib is called right at the start. The easiest workaround for now I think is to time the methods calls carefully, e.g. after a user click.
[1] https://lists.apache.org/thread.html/r2f2d8f68936f9bbf061a80a8ff996bc0398e74c6349ad6e28402d4d0%40%3Cdev.royale.apache.org%3E
On 2021/10/19 10:18:03, Maria Jose Esteve <mj...@iest.com>> wrote:
> Exactly, that's what happens to me when I launch against localhost, the js hasn't loaded yet but I don't know how to fix it. I tried monitoring the network and I see it loads but App loads before.... In theory the scripts inside the "body" shouldn't they run after all the js have loaded?
> I've tried to force it, with a custom loader in js but nothing worked,
> probably because I'm not doing it correctly :( Maybe there is a way to make App.start() wait until all the js are loaded?
>
> Hiedra
>
> -----Mensaje original-----
> De: Yishay Weiss <yi...@hotmail.com>> Enviado el: martes, 19 de
> octubre de 2021 12:05
> Para: dev@royale.apache.org<ma...@royale.apache.org>
> Asunto: RE: Strangled with a new Royale wrapper component
>
> *method later
>
> From: Yishay Weiss<ma...@hotmail.com>
> Sent: Tuesday, October 19, 2021 1:04 PM
> To: dev@royale.apache.org<ma...@royale.apache.org>>
> Subject: RE: Strangled with a new Royale wrapper component
>
> Are you sure "resources/office/office.js" is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
>
> Just some quick thoughts.
>
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Tuesday, October 19, 2021 3:48 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I
> get the following error: ReferenceError: Can't find variable:
> OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
>
>
RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Posted by Maria Jose Esteve <mj...@iest.com>.
Hello,
I wish I could get to an "end" point with this problem, although it seems it won't be today 😝
I've read Harb's article (with some tests, none of them definitive) and I've added, manually, the "defer" attribute to the script where the dependencies are added and, to test, also to the body script where the App.Start() is launched but nothing seems to work for me. (It only works in Firefox, but before including "defer" it also worked 98% of the time)
I keep getting errors when running from localhost:
<script type="text/javascript" src="./library/closure/goog/base.js"></script>
<script type="text/javascript" defer>
// generated by Royale
goog.addDependency('../../../App.js', ['App'], ['org.apache.royale.community.beads.models
<body>
<script type="text/javascript" defer>
new App().start();
</script>
[cid:image001.png@01D7C549.CA63EDB0]
@Brian, could you specify how you have implemented it in the pom?
Thx.
Hiedra.
-----Mensaje original-----
De: Brian Raymes <br...@teotech.com>
Enviado el: martes, 19 de octubre de 2021 23:42
Para: dev@royale.apache.org
Asunto: RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
What I have done to solve this issue is simply added the "defer" attribute to the script block for App.js (using maven-replacer-plugin with maven at package time).
https://www.w3schools.com/tags/att_script_defer.asp
"The script is downloaded in parallel to parsing the page, and executed after the page has finished parsing"
Brian
-----Original Message-----
From: Yishay Weiss <yi...@apache.org>>
Sent: Tuesday, October 19, 2021 3:43 AM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
> Maybe there is a way to make App.start() wait until all the js are loaded?
FWIW, this has already been discussed [1] extensively. I think the conclusion was that in most cases loading order will not be so so important, unless a JS lib is called right at the start. The easiest workaround for now I think is to time the methods calls carefully, e.g. after a user click.
[1] https://lists.apache.org/thread.html/r2f2d8f68936f9bbf061a80a8ff996bc0398e74c6349ad6e28402d4d0%40%3Cdev.royale.apache.org%3E
On 2021/10/19 10:18:03, Maria Jose Esteve <mj...@iest.com>> wrote:
> Exactly, that's what happens to me when I launch against localhost, the js hasn't loaded yet but I don't know how to fix it. I tried monitoring the network and I see it loads but App loads before.... In theory the scripts inside the "body" shouldn't they run after all the js have loaded?
> I've tried to force it, with a custom loader in js but nothing worked,
> probably because I'm not doing it correctly :( Maybe there is a way to make App.start() wait until all the js are loaded?
>
> Hiedra
>
> -----Mensaje original-----
> De: Yishay Weiss <yi...@hotmail.com>> Enviado el: martes, 19 de
> octubre de 2021 12:05
> Para: dev@royale.apache.org<ma...@royale.apache.org>
> Asunto: RE: Strangled with a new Royale wrapper component
>
> *method later
>
> From: Yishay Weiss<ma...@hotmail.com>
> Sent: Tuesday, October 19, 2021 1:04 PM
> To: dev@royale.apache.org<ma...@royale.apache.org>>
> Subject: RE: Strangled with a new Royale wrapper component
>
> Are you sure "resources/office/office.js" is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
>
> Just some quick thoughts.
>
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Tuesday, October 19, 2021 3:48 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I
> get the following error: ReferenceError: Can't find variable:
> OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
>
>
RE: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
Posted by Brian Raymes <br...@teotech.com>.
What I have done to solve this issue is simply added the "defer" attribute to the script block for App.js (using maven-replacer-plugin with maven at package time).
https://www.w3schools.com/tags/att_script_defer.asp
"The script is downloaded in parallel to parsing the page, and executed after the page has finished parsing"
Brian
-----Original Message-----
From: Yishay Weiss <yi...@apache.org>
Sent: Tuesday, October 19, 2021 3:43 AM
To: dev@royale.apache.org
Subject: [EXTERNAL] Re: RE: Strangled with a new Royale wrapper component
> Maybe there is a way to make App.start() wait until all the js are loaded?
FWIW, this has already been discussed [1] extensively. I think the conclusion was that in most cases loading order will not be so so important, unless a JS lib is called right at the start. The easiest workaround for now I think is to time the methods calls carefully, e.g. after a user click.
[1] https://lists.apache.org/thread.html/r2f2d8f68936f9bbf061a80a8ff996bc0398e74c6349ad6e28402d4d0%40%3Cdev.royale.apache.org%3E
On 2021/10/19 10:18:03, Maria Jose Esteve <mj...@iest.com> wrote:
> Exactly, that's what happens to me when I launch against localhost, the js hasn't loaded yet but I don't know how to fix it. I tried monitoring the network and I see it loads but App loads before.... In theory the scripts inside the "body" shouldn't they run after all the js have loaded?
> I've tried to force it, with a custom loader in js but nothing worked,
> probably because I'm not doing it correctly :( Maybe there is a way to make App.start() wait until all the js are loaded?
>
> Hiedra
>
> -----Mensaje original-----
> De: Yishay Weiss <yi...@hotmail.com> Enviado el: martes, 19 de
> octubre de 2021 12:05
> Para: dev@royale.apache.org
> Asunto: RE: Strangled with a new Royale wrapper component
>
> *method later
>
> From: Yishay Weiss<ma...@hotmail.com>
> Sent: Tuesday, October 19, 2021 1:04 PM
> To: dev@royale.apache.org<ma...@royale.apache.org>
> Subject: RE: Strangled with a new Royale wrapper component
>
> Are you sure "resources/office/office.js" is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
>
> Just some quick thoughts.
>
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Tuesday, October 19, 2021 3:48 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I
> get the following error: ReferenceError: Can't find variable:
> OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
>
>
Re: RE: Strangled with a new Royale wrapper component
Posted by Yishay Weiss <yi...@apache.org>.
> Maybe there is a way to make App.start() wait until all the js are loaded?
FWIW, this has already been discussed [1] extensively. I think the conclusion was that in most cases loading order will not be so so important, unless a JS lib is called right at the start. The easiest workaround for now I think is to time the methods calls carefully, e.g. after a user click.
[1] https://lists.apache.org/thread.html/r2f2d8f68936f9bbf061a80a8ff996bc0398e74c6349ad6e28402d4d0%40%3Cdev.royale.apache.org%3E
On 2021/10/19 10:18:03, Maria Jose Esteve <mj...@iest.com> wrote:
> Exactly, that's what happens to me when I launch against localhost, the js hasn't loaded yet but I don't know how to fix it. I tried monitoring the network and I see it loads but App loads before.... In theory the scripts inside the "body" shouldn't they run after all the js have loaded?
> I've tried to force it, with a custom loader in js but nothing worked, probably because I'm not doing it correctly :(
> Maybe there is a way to make App.start() wait until all the js are loaded?
>
> Hiedra
>
> -----Mensaje original-----
> De: Yishay Weiss <yi...@hotmail.com>
> Enviado el: martes, 19 de octubre de 2021 12:05
> Para: dev@royale.apache.org
> Asunto: RE: Strangled with a new Royale wrapper component
>
> *method later
>
> From: Yishay Weiss<ma...@hotmail.com>
> Sent: Tuesday, October 19, 2021 1:04 PM
> To: dev@royale.apache.org<ma...@royale.apache.org>
> Subject: RE: Strangled with a new Royale wrapper component
>
> Are you sure "resources/office/office.js" is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
>
> Just some quick thoughts.
>
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Tuesday, October 19, 2021 3:48 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I get the following error: ReferenceError: Can't find variable: OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
>
>
Re: Strangled with a new Royale wrapper component
Posted by Hugo Ferreira <hf...@gmail.com>.
I will investigate all this possibilities.
Maria Jose Esteve <mj...@iest.com> escreveu no dia terça, 19/10/2021
à(s) 11:18:
> Exactly, that's what happens to me when I launch against localhost, the js
> hasn't loaded yet but I don't know how to fix it. I tried monitoring the
> network and I see it loads but App loads before.... In theory the scripts
> inside the "body" shouldn't they run after all the js have loaded?
> I've tried to force it, with a custom loader in js but nothing worked,
> probably because I'm not doing it correctly :(
> Maybe there is a way to make App.start() wait until all the js are loaded?
>
> Hiedra
>
> -----Mensaje original-----
> De: Yishay Weiss <yi...@hotmail.com>
> Enviado el: martes, 19 de octubre de 2021 12:05
> Para: dev@royale.apache.org
> Asunto: RE: Strangled with a new Royale wrapper component
>
> *method later
>
> From: Yishay Weiss<ma...@hotmail.com>
> Sent: Tuesday, October 19, 2021 1:04 PM
> To: dev@royale.apache.org<ma...@royale.apache.org>
> Subject: RE: Strangled with a new Royale wrapper component
>
> Are you sure "resources/office/office.js" is being loaded in time? IIRC
> you can look in the html elements panel and look for the <script> element.
> Also, keep in mind that loading a script is an async operation so maybe
> calling the method layer will help?
>
> Just some quick thoughts.
>
>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Tuesday, October 19, 2021 3:48 AM
> To: Apache Royale Development<ma...@royale.apache.org>
> Subject: Strangled with a new Royale wrapper component
>
> Hi,
>
> I'm strangled with an issue.
> I'm developing a wrapper for office.js (office web add-In).
>
> I have this file OfficeAddIn.as in src root folder with the following
> content:
>
> package
> {
> import org.apache.royale.events.EventDispatcher;
>
> /**
> * @externs
> */
> COMPILE::JS
> public class OfficeAddIn extends EventDispatcher {
> /**
> * <inject_script>
> * var script = document.createElement("script");
> * script.setAttribute("src", "resources/office/office.js");
> * document.head.appendChild(script);
> * </inject_script>
> */
> public function OfficeAddIn(){}
>
> public static function writeData():void {} } }
>
> At runtime when I run the writeData method from actionscript code, I get
> the following error: ReferenceError: Can't find variable: OfficeAddIn
>
> It's not my first Royale wrapper and I copied from the first one.
>
> Thanks in advance,
> Hugo.
>
>
>
RE: Strangled with a new Royale wrapper component
Posted by Maria Jose Esteve <mj...@iest.com>.
Exactly, that's what happens to me when I launch against localhost, the js hasn't loaded yet but I don't know how to fix it. I tried monitoring the network and I see it loads but App loads before.... In theory the scripts inside the "body" shouldn't they run after all the js have loaded?
I've tried to force it, with a custom loader in js but nothing worked, probably because I'm not doing it correctly :(
Maybe there is a way to make App.start() wait until all the js are loaded?
Hiedra
-----Mensaje original-----
De: Yishay Weiss <yi...@hotmail.com>
Enviado el: martes, 19 de octubre de 2021 12:05
Para: dev@royale.apache.org
Asunto: RE: Strangled with a new Royale wrapper component
*method later
From: Yishay Weiss<ma...@hotmail.com>
Sent: Tuesday, October 19, 2021 1:04 PM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: RE: Strangled with a new Royale wrapper component
Are you sure "resources/office/office.js" is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
Just some quick thoughts.
From: Hugo Ferreira<ma...@gmail.com>
Sent: Tuesday, October 19, 2021 3:48 AM
To: Apache Royale Development<ma...@royale.apache.org>
Subject: Strangled with a new Royale wrapper component
Hi,
I'm strangled with an issue.
I'm developing a wrapper for office.js (office web add-In).
I have this file OfficeAddIn.as in src root folder with the following content:
package
{
import org.apache.royale.events.EventDispatcher;
/**
* @externs
*/
COMPILE::JS
public class OfficeAddIn extends EventDispatcher {
/**
* <inject_script>
* var script = document.createElement("script");
* script.setAttribute("src", "resources/office/office.js");
* document.head.appendChild(script);
* </inject_script>
*/
public function OfficeAddIn(){}
public static function writeData():void {} } }
At runtime when I run the writeData method from actionscript code, I get the following error: ReferenceError: Can't find variable: OfficeAddIn
It's not my first Royale wrapper and I copied from the first one.
Thanks in advance,
Hugo.
RE: Strangled with a new Royale wrapper component
Posted by Yishay Weiss <yi...@hotmail.com>.
*method later
From: Yishay Weiss<ma...@hotmail.com>
Sent: Tuesday, October 19, 2021 1:04 PM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: RE: Strangled with a new Royale wrapper component
Are you sure “resources/office/office.js” is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
Just some quick thoughts.
From: Hugo Ferreira<ma...@gmail.com>
Sent: Tuesday, October 19, 2021 3:48 AM
To: Apache Royale Development<ma...@royale.apache.org>
Subject: Strangled with a new Royale wrapper component
Hi,
I'm strangled with an issue.
I'm developing a wrapper for office.js (office web add-In).
I have this file OfficeAddIn.as in src root folder with the
following content:
package
{
import org.apache.royale.events.EventDispatcher;
/**
* @externs
*/
COMPILE::JS
public class OfficeAddIn extends EventDispatcher
{
/**
* <inject_script>
* var script = document.createElement("script");
* script.setAttribute("src", "resources/office/office.js");
* document.head.appendChild(script);
* </inject_script>
*/
public function OfficeAddIn(){}
public static function writeData():void {}
}
}
At runtime when I run the writeData method from actionscript code, I get
the following error: ReferenceError: Can't find variable: OfficeAddIn
It's not my first Royale wrapper and I copied from the first one.
Thanks in advance,
Hugo.
RE: Strangled with a new Royale wrapper component
Posted by Yishay Weiss <yi...@hotmail.com>.
Are you sure “resources/office/office.js” is being loaded in time? IIRC you can look in the html elements panel and look for the <script> element. Also, keep in mind that loading a script is an async operation so maybe calling the method layer will help?
Just some quick thoughts.
From: Hugo Ferreira<ma...@gmail.com>
Sent: Tuesday, October 19, 2021 3:48 AM
To: Apache Royale Development<ma...@royale.apache.org>
Subject: Strangled with a new Royale wrapper component
Hi,
I'm strangled with an issue.
I'm developing a wrapper for office.js (office web add-In).
I have this file OfficeAddIn.as in src root folder with the
following content:
package
{
import org.apache.royale.events.EventDispatcher;
/**
* @externs
*/
COMPILE::JS
public class OfficeAddIn extends EventDispatcher
{
/**
* <inject_script>
* var script = document.createElement("script");
* script.setAttribute("src", "resources/office/office.js");
* document.head.appendChild(script);
* </inject_script>
*/
public function OfficeAddIn(){}
public static function writeData():void {}
}
}
At runtime when I run the writeData method from actionscript code, I get
the following error: ReferenceError: Can't find variable: OfficeAddIn
It's not my first Royale wrapper and I copied from the first one.
Thanks in advance,
Hugo.