You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by MARK HARTNETT <m_...@comcast.net> on 2024/05/02 16:44:13 UTC
JS questions
Hi all,
All of my errors right now are null references.
In this code gp.hpc crashes because hpc is null at this point.
In Flex, I didn't care about that because once init() was done it was no longer null.
<ns7:CustomButtonBar id="topCBB"
btnA="['Home','Statistics','Network','MCA Grid']"
btnBoxA="{[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
itemH="36"
fntSz="16"/>
With JS the null hpc throws an error.
Moving those variables to creationComplete solves the problem.
What is the difference with JS binding and Flex in terms of timing and object creation?
Is there a a bead that allows nulls?
Thanks
Re: JS questions
Posted by Alex Harui via users <us...@royale.apache.org>.
Are you sure ‘hpc’ is null? I would expect that ‘gp’ is null. Where is ‘gp’ defined?
There definitely can be differences in the timing of when things are created in Royale compared to Flex. Could still be a bug in the generated code. Or could be a restriction that Royale wants to dynamically create more things and so some variables won’t be ready when the array is constructed.
HTH,
-Alex
From: MARK HARTNETT <m_...@comcast.net>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Thursday, May 2, 2024 at 9:45 AM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: JS questions
EXTERNAL: Use caution when clicking on links or opening attachments.
Hi all,
All of my errors right now are null references.
In this code gp.hpc crashes because hpc is null at this point.
In Flex, I didn't care about that because once init() was done it was no longer null.
<ns7:CustomButtonBar id="topCBB"
btnA="['Home','Statistics','Network','MCA Grid']"
btnBoxA="{[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
itemH="36"
fntSz="16"/>
With JS the null hpc throws an error.
Moving those variables to creationComplete solves the problem.
What is the difference with JS binding and Flex in terms of timing and object creation?
Is there a a bead that allows nulls?
Thanks
Re: Update Server setting
Posted by Piotr Zarzycki <pi...@gmail.com>.
Hi Mark,
This is definitely not related to Moonshine. What browser are you using?
Usually Firefox is less restrictive in case of Cors. - It's just quick
thought.
Thanks,
Piotr
pon., 6 maj 2024 o 15:51 MARK HARTNETT <m_...@comcast.net> napisał(a):
> Hi Piotr, Still stuck on the small bug. Below you can see I made a request
> from localhost and then from my external Tomcat server at
> www.causeLogix.com and received that same message. These are both being
> requested through Moonshine server localhost:3000.
>
> *The option Access-Control-Allow-Origin:* * needs to be in the page
> header. You mentioned using Apache Server and I have learned the it has
> configurations for control access. If you know how Moonshine sets that
> option can you let me know.
>
> I've tried everything - CORS Filter in web xml, disabling localhost Cors
> in my browser and a number other little fixes. Tomcat is integrated into
> Eclipse so it might be setting some values behind the scenes.
>
> I can add Apache server to the mix but I have so many older development
> tools it might cause problems. So if you don't have any ideas on Moonshine
> - I'll setup a clean machine and go from there.
>
> *Access to XMLHttpRequest at
> 'http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak
> <http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak>'
> from origin 'http://localhost:3000 <http://localhost:3000/>' has been
> blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present
> on the requested resource.*
>
> *Access to XMLHttpRequest at
> 'http://www.causeLogix.com/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak
> <http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak>'
> from origin 'http://localhost:3000 <http://localhost:3000/>?
> <http://localhost:3000/>' has been blocked by CORS policy: No
> 'Access-Control-Allow-Origin' header is present on the requested resosurce.*
>
>
>
>
--
Piotr Zarzycki
Re: Update Server setting
Posted by MARK HARTNETT <m_...@comcast.net>.
For anyone following this - Harbs suggested turning off Cors policy in the browser. I tried a few plugins and the flags method but they didn't work. I used allow CORS plugin today and it worked perfect - Gave me a whitelist for localhost:3000 and it worked. I uploaded the screen - nice product
"Allow CORS: Access-Control-Allow-Origin 0.1.9" Easily add (Access-Control-Allow-Origin: *) rule to the response header.
> On 05/06/2024 9:50 AM EDT MARK HARTNETT <m_...@comcast.net> wrote:
>
>
> Hi Piotr, Still stuck on the small bug. Below you can see I made a request from localhost and then from my external Tomcat server athttp://www.causeLogix.com and received that same message. These are both being requested through Moonshine server localhost:3000.
>
> The option Access-Control-Allow-Origin:* needs to be in the page header. You mentioned using Apache Server and I have learned the it has configurations for control access. If you know how Moonshine sets that option can you let me know.
>
> I've tried everything - CORS Filter in web xml, disabling localhost Cors in my browser and a number other little fixes. Tomcat is integrated into Eclipse so it might be setting some values behind the scenes.
>
> I can add Apache server to the mix but I have so many older development tools it might cause problems. So if you don't have any ideas on Moonshine - I'll setup a clean machine and go from there.
>
> Access to XMLHttpRequest at 'http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak' from origin 'http://localhost:3000/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
>
> Access to XMLHttpRequest at 'http://www.causeLogix.com/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak' from origin 'http://localhost:3000/? http://localhost:3000/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resosurce.
>
>
>
>
Re: Update Server setting
Posted by MARK HARTNETT <m_...@comcast.net>.
Hi Piotr, Still stuck on the small bug. Below you can see I made a request from localhost and then from my external Tomcat server athttp://www.causeLogix.com and received that same message. These are both being requested through Moonshine server localhost:3000.
The option Access-Control-Allow-Origin:* needs to be in the page header. You mentioned using Apache Server and I have learned the it has configurations for control access. If you know how Moonshine sets that option can you let me know.
I've tried everything - CORS Filter in web xml, disabling localhost Cors in my browser and a number other little fixes. Tomcat is integrated into Eclipse so it might be setting some values behind the scenes.
I can add Apache server to the mix but I have so many older development tools it might cause problems. So if you don't have any ideas on Moonshine - I'll setup a clean machine and go from there.
Access to XMLHttpRequest at 'http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak' from origin 'http://localhost:3000/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Access to XMLHttpRequest at 'http://www.causeLogix.com/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak' from origin 'http://localhost:3000/? http://localhost:3000/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resosurce.
Re: Update Server setting
Posted by MARK HARTNETT <m_...@comcast.net>.
In Eclipse both the app and tomcat are on localhost:8080 so CORS policy is not a problem.
I'm running Tomcat using the Eclipse IDE which is on 8080 and moonshine is localhost:3000
As Harbs suggested, I downoaded an extension that unblocks Cors Policy but I still have to play around with it.
Maybe my easiest solution is to point Tomcat to 3000 or Moonshine to 8080.
That's tomorrows first thing.
> On 05/04/2024 5:56 PM EDT Piotr Zarzycki <pi...@gmail.com> wrote:
>
>
> How are you launching your app? Trough Build and Debug in Moonshine ?
>
> You need to probably run your all trough the local http server. Setup some using Xampp or any other tool.
>
>
> Piotr Zarzycki
>
>
>
> On Sat, 4 May 2024 at 22:12, MARK HARTNETT <m_hartnett@comcast.net mailto:m_hartnett@comcast.net> wrote:
>
> > The CORs policy restricts unknown servers from exchanging data. Tomcat needs a CorsFilter.jar and CorsFilter defined in the Tomcat6/conf/Web.xml and an entry for localhost:3000. I did that and still the same error.
> >
> > When I press the login button, the connection is actually successful. I see it in the db log.
> > Somewhere between the connection and the return the cors error is thrown.
> > "http://localhost:3000' has been blocked by CORS policy" - Seems to say Tomcat did the blocking
> >
> > It's funny that I need to get by the login screen to work on the rest of the system.
> >
> > Access to XMLHttpRequest at 'http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
> >
> >
> > > On 05/04/2024 8:47 AM EDT MARK HARTNETT <m_hartnett@comcast.net mailto:m_hartnett@comcast.net> wrote:
> > >
> > >
> > > Hi all,
> > >
> > > My db server is up and running on 8080 and I get CORS policy: No 'Access-Control-Allow-Origin' error on connection. I'm guessing this is a server setting but I haven't been able to find the solution.
> > >
> > > Access to XMLHttpRequest at 'http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
> > >
> > > Thanks
> > >
> > > > On 05/04/2024 8:36 AM EDT MARK HARTNETT <m_hartnett@comcast.net mailto:m_hartnett@comcast.net> wrote:
> > > >
> > > >
> > > > Almost every error has been a null reference and Iv'e either moved the code to creationComplete or did as did as Maria said used ternary statements.
> > > >
> > > > The spark and mx comboBox always fails when the dataProvider is initially null. The JS checks to see if the labelField is blank and adds "label" as the labelField. (I think it's supposed to exit here)The the dp is accesed using the labelField and throws an error.
> > > >
> > > > I switched to the Jewel comboBox and all of the null errors disappeared but a lot of extra attribute errors. I have a lot of ComboBoxes with some special functionality so I extended the Jewel CB and added some attributes that get created as beads if not null. I did a global change from s:ComboBox to my extended CL:ComboBox, and the system opened login with no errors in the log.
> > > >
> > > > <j:ComboBox xmlns:fx="http://ns.adobe.com/mxml/2009"
> > > > xmlns:j="library://http://ns.apache.org/royale/jewel">
> > > >
> > > > <fx:Script>
> > > > <![CDATA[
> > > > [Bindable]public var editable:Boolean = true;
> > > > [Bindable]public var enabled:Boolean = true;
> > > > [Bindable]public var selected:Boolean = true;
> > > > [Bindable]public var restrict:String=null;
> > > > ]]>
> > > > </fx:Script>
> > > > </j:ComboBox>
> > > >
> > > >
> > > >
> > > >
> > > > > On 05/02/2024 2:29 PM EDT Maria Jose Esteve <mjesteve@iest.com mailto:mjesteve@iest.com> wrote:
> > > > >
> > > > >
> > > > >
> > > > > Hi Mark,
> > > > >
> > > > > I don't know how the binding in Flex worked internally but if gp is null an error would surely occur, perhaps it was an internal error that was intercepted but...
> > > > >
> > > > > I can share with you how I do it, although I don't know if it is the best way:
> > > > >
> > > > > <ns7:CustomButtonBar id="topCBB"
> > > > > btnA="['Home','Statistics','Network','MCA Grid']"
> > > > > btnBoxA="{!gp?[]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> > > > > itemH="36"
> > > > > fntSz="16"/>
> > > > >
> > > > >
> > > > >
> > > > > Or
> > > > > btnBoxA="{!gp?null:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> > > > >
> > > > > Or
> > > > > btnBoxA="{!gp?[null,null,null,null]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> > > > >
> > > > >
> > > > >
> > > > > It depends on what works for you.
> > > > >
> > > > >
> > > > > Hiedra
> > > > >
> > > > > De: MARK HARTNETT <m_hartnett@comcast.net mailto:m_hartnett@comcast.net>
> > > > > Enviado el: jueves, 2 de mayo de 2024 18:44
> > > > > Para: users@royale.apache.org mailto:users@royale.apache.org
> > > > > Asunto: JS questions
> > > > >
> > > > >
> > > > >
> > > > > Hi all,
> > > > >
> > > > > All of my errors right now are null references.
> > > > >
> > > > >
> > > > >
> > > > > In this code gp.hpc crashes because hpc is null at this point.
> > > > >
> > > > > In Flex, I didn't care about that because once init() was done it was no longer null.
> > > > >
> > > > >
> > > > >
> > > > > <ns7:CustomButtonBar id="topCBB"
> > > > > btnA="['Home','Statistics','Network','MCA Grid']"
> > > > > btnBoxA="{[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> > > > > itemH="36"
> > > > > fntSz="16"/>
> > > > >
> > > > >
> > > > >
> > > > > With JS the null hpc throws an error.
> > > > >
> > > > > Moving those variables to creationComplete solves the problem.
> > > > >
> > > > >
> > > > >
> > > > > What is the difference with JS binding and Flex in terms of timing and object creation?
> > > > >
> > > > > Is there a a bead that allows nulls?
> > > > >
> > > > >
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>
Re: Update Server setting
Posted by Piotr Zarzycki <pi...@gmail.com>.
How are you launching your app? Trough Build and Debug in Moonshine ?
You need to probably run your all trough the local http server. Setup some
using Xampp or any other tool.
Piotr Zarzycki
On Sat, 4 May 2024 at 22:12, MARK HARTNETT <m_...@comcast.net> wrote:
> The CORs policy restricts unknown servers from exchanging data. Tomcat
> needs a CorsFilter.jar and CorsFilter defined in the Tomcat6/conf/Web.xml
> and an entry for localhost:3000. I did that and still the same error.
>
> When I press the login button, the connection is actually successful. I
> see it in the db log.
> Somewhere between the connection and the return the cors error is thrown.
> *"http://localhost:3000 <http://localhost:3000>' has been blocked by CORS
> policy" - Seems to say Tomcat did the blocking*
>
> It's funny that I need to get by the login screen to work on the rest of
> the system.
>
> *Access to XMLHttpRequest at
> 'http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak
> <http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak>'
> from origin 'http://localhost:3000 <http://localhost:3000>' has been
> blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present
> on the requested resource.*
>
>
> On 05/04/2024 8:47 AM EDT MARK HARTNETT <m_...@comcast.net> wrote:
>
>
> Hi all,
>
> My db server is up and running on 8080 and I get *CORS policy*: No
> 'Access-Control-Allow-Origin' error on connection. I'm guessing this is a
> server setting but I haven't been able to find the solution.
>
> Access to XMLHttpRequest at '
> http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak'
> from origin 'http://localhost:3000' has been blocked by* CORS policy*: No
> 'Access-Control-Allow-Origin' header is present on the requested resource.
>
> Thanks
>
> On 05/04/2024 8:36 AM EDT MARK HARTNETT <m_...@comcast.net> wrote:
>
>
> Almost every error has been a null reference and Iv'e either moved the
> code to creationComplete or did as did as Maria said used ternary
> statements.
>
> The spark and mx comboBox always fails when the dataProvider is initially
> null. The JS checks to see if the labelField is blank and adds "label" as
> the labelField. (I think it's supposed to exit here)The the dp is accesed
> using the labelField and throws an error.
>
> I switched to the Jewel comboBox and all of the null errors disappeared
> but a lot of extra attribute errors. I have a lot of ComboBoxes with some
> special functionality so I extended the Jewel CB and added some attributes
> that get created as beads if not null. I did a global change from
> s:ComboBox to my extended CL:ComboBox, and the system opened login with no
> errors in the log.
>
> *<j:ComboBox xmlns:fx="http://ns.adobe.com/mxml/2009
> <http://ns.adobe.com/mxml/2009>"*
> *xmlns:j="library://ns.apache.org/royale/jewel
> <http://ns.apache.org/royale/jewel>"> *
>
> *<fx:Script>*
> *<![CDATA[*
> *[Bindable]public var editable:Boolean = true;*
> *[Bindable]public var enabled:Boolean = true;*
> *[Bindable]public var selected:Boolean = true;*
> *[Bindable]public var restrict:String=null;*
> *]]> *
> *</fx:Script>*
> *</j:ComboBox>*
>
>
>
>
> On 05/02/2024 2:29 PM EDT Maria Jose Esteve <mj...@iest.com> wrote:
>
>
>
> Hi Mark,
>
> I don't know how the binding in Flex worked internally but if gp is null
> an error would surely occur, perhaps it was an internal error that was
> intercepted but...
>
> I can share with you how I do it, although I don't know if it is the best
> way:
>
> *<ns7:CustomButtonBar id="topCBB"*
> *btnA="['Home','Statistics','Network','MCA Grid']"*
> *btnBoxA="{!gp?[]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl,
> gp.dgBOX]}" *
> *itemH="36"*
> *fntSz="16"/>*
>
>
>
> Or
> *btnBoxA="{!gp?null:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl,
> gp.dgBOX]}" *
>
> Or
> *btnBoxA="{!gp?[null,null,null,null]:[gp.hpc, gp.statisticsCtrl,
> gp.siteNetworkCtrl, gp.dgBOX]}" *
>
>
>
> It depends on what works for you.
>
> Hiedra
>
> *De:* MARK HARTNETT <m_...@comcast.net>
> *Enviado el:* jueves, 2 de mayo de 2024 18:44
> *Para:* users@royale.apache.org
> *Asunto:* JS questions
>
>
>
> Hi all,
>
> All of my errors right now are null references.
>
>
>
> In this code gp.hpc crashes because hpc is null at this point.
>
> In Flex, I didn't care about that because once init() was done it was no
> longer null.
>
>
>
> *<ns7:CustomButtonBar id="topCBB"*
> *btnA="['Home','Statistics','Network','MCA Grid']"*
> *btnBoxA="{[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}" *
> *itemH="36"*
> *fntSz="16"/>*
>
>
>
> With JS the null hpc throws an error.
>
> Moving those variables to creationComplete solves the problem.
>
>
>
> What is the difference with JS binding and Flex in terms of timing and
> object creation?
>
> Is there a a bead that allows nulls?
>
>
>
> Thanks
>
>
>
>
>
>
Re: Update Server setting
Posted by Harbs <ha...@gmail.com>.
You can turn off CORS restrictions for localhost in your browser. That might make development easier.
Harbs
> On May 4, 2024, at 11:11 PM, MARK HARTNETT <m_...@comcast.net> wrote:
>
> The CORs policy restricts unknown servers from exchanging data. Tomcat needs a CorsFilter.jar and CorsFilter defined in the Tomcat6/conf/Web.xml and an entry for localhost:3000. I did that and still the same error.
>
> When I press the login button, the connection is actually successful. I see it in the db log.
> Somewhere between the connection and the return the cors error is thrown.
> "http://localhost:3000' has been blocked by CORS policy" - Seems to say Tomcat did the blocking
>
> It's funny that I need to get by the login screen to work on the rest of the system.
>
> Access to XMLHttpRequest at 'http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
>
>> On 05/04/2024 8:47 AM EDT MARK HARTNETT <m_...@comcast.net> wrote:
>>
>>
>> Hi all,
>>
>> My db server is up and running on 8080 and I get CORS policy: No 'Access-Control-Allow-Origin' error on connection. I'm guessing this is a server setting but I haven't been able to find the solution.
>>
>> Access to XMLHttpRequest at 'http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
>>
>> Thanks
>>> On 05/04/2024 8:36 AM EDT MARK HARTNETT <m_...@comcast.net> wrote:
>>>
>>>
>>> Almost every error has been a null reference and Iv'e either moved the code to creationComplete or did as did as Maria said used ternary statements.
>>>
>>> The spark and mx comboBox always fails when the dataProvider is initially null. The JS checks to see if the labelField is blank and adds "label" as the labelField. (I think it's supposed to exit here)The the dp is accesed using the labelField and throws an error.
>>>
>>> I switched to the Jewel comboBox and all of the null errors disappeared but a lot of extra attribute errors. I have a lot of ComboBoxes with some special functionality so I extended the Jewel CB and added some attributes that get created as beads if not null. I did a global change from s:ComboBox to my extended CL:ComboBox, and the system opened login with no errors in the log.
>>>
>>> <j:ComboBox xmlns:fx="http://ns.adobe.com/mxml/2009"
>>> xmlns:j="library://ns.apache.org/royale/jewel">
>>>
>>> <fx:Script>
>>> <![CDATA[
>>> [Bindable]public var editable:Boolean = true;
>>> [Bindable]public var enabled:Boolean = true;
>>> [Bindable]public var selected:Boolean = true;
>>> [Bindable]public var restrict:String=null;
>>> ]]>
>>> </fx:Script>
>>> </j:ComboBox>
>>>
>>>
>>>
>>>> On 05/02/2024 2:29 PM EDT Maria Jose Esteve <mj...@iest.com> wrote:
>>>>
>>>>
>>>> Hi Mark,
>>>>
>>>> I don't know how the binding in Flex worked internally but if gp is null an error would surely occur, perhaps it was an internal error that was intercepted but...
>>>>
>>>> I can share with you how I do it, although I don't know if it is the best way:
>>>>
>>>> <ns7:CustomButtonBar id="topCBB"
>>>> btnA="['Home','Statistics','Network','MCA Grid']"
>>>> btnBoxA="{!gp?[]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
>>>> itemH="36"
>>>> fntSz="16"/>
>>>>
>>>>
>>>> Or
>>>> btnBoxA="{!gp?null:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
>>>>
>>>> Or
>>>> btnBoxA="{!gp?[null,null,null,null]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
>>>>
>>>>
>>>> It depends on what works for you.
>>>>
>>>>
>>>> Hiedra
>>>>
>>>> De: MARK HARTNETT <m_...@comcast.net>
>>>> Enviado el: jueves, 2 de mayo de 2024 18:44
>>>> Para: users@royale.apache.org
>>>> Asunto: JS questions
>>>>
>>>>
>>>> Hi all,
>>>>
>>>> All of my errors right now are null references.
>>>>
>>>>
>>>> In this code gp.hpc crashes because hpc is null at this point.
>>>>
>>>> In Flex, I didn't care about that because once init() was done it was no longer null.
>>>>
>>>>
>>>> <ns7:CustomButtonBar id="topCBB"
>>>> btnA="['Home','Statistics','Network','MCA Grid']"
>>>> btnBoxA="{[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
>>>> itemH="36"
>>>> fntSz="16"/>
>>>>
>>>>
>>>> With JS the null hpc throws an error.
>>>>
>>>> Moving those variables to creationComplete solves the problem.
>>>>
>>>>
>>>> What is the difference with JS binding and Flex in terms of timing and object creation?
>>>>
>>>> Is there a a bead that allows nulls?
>>>>
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
Update Server setting
Posted by MARK HARTNETT <m_...@comcast.net>.
The CORs policy restricts unknown servers from exchanging data. Tomcat needs a CorsFilter.jar and CorsFilter defined in the Tomcat6/conf/Web.xml and an entry for localhost:3000. I did that and still the same error.
When I press the login button, the connection is actually successful. I see it in the db log.
Somewhere between the connection and the return the cors error is thrown.
"http://localhost:3000' has been blocked by CORS policy" - Seems to say Tomcat did the blocking
It's funny that I need to get by the login screen to work on the rest of the system.
Access to XMLHttpRequest at 'http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
> On 05/04/2024 8:47 AM EDT MARK HARTNETT <m_...@comcast.net> wrote:
>
>
> Hi all,
>
> My db server is up and running on 8080 and I get CORS policy: No 'Access-Control-Allow-Origin' error on connection. I'm guessing this is a server setting but I haven't been able to find the solution.
>
> Access to XMLHttpRequest at 'http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
>
> Thanks
>
> > On 05/04/2024 8:36 AM EDT MARK HARTNETT <m_...@comcast.net> wrote:
> >
> >
> > Almost every error has been a null reference and Iv'e either moved the code to creationComplete or did as did as Maria said used ternary statements.
> >
> > The spark and mx comboBox always fails when the dataProvider is initially null. The JS checks to see if the labelField is blank and adds "label" as the labelField. (I think it's supposed to exit here)The the dp is accesed using the labelField and throws an error.
> >
> > I switched to the Jewel comboBox and all of the null errors disappeared but a lot of extra attribute errors. I have a lot of ComboBoxes with some special functionality so I extended the Jewel CB and added some attributes that get created as beads if not null. I did a global change from s:ComboBox to my extended CL:ComboBox, and the system opened login with no errors in the log.
> >
> > <j:ComboBox xmlns:fx="http://ns.adobe.com/mxml/2009"
> > xmlns:j="library://ns.apache.org/royale/jewel">
> >
> > <fx:Script>
> > <![CDATA[
> > [Bindable]public var editable:Boolean = true;
> > [Bindable]public var enabled:Boolean = true;
> > [Bindable]public var selected:Boolean = true;
> > [Bindable]public var restrict:String=null;
> > ]]>
> > </fx:Script>
> > </j:ComboBox>
> >
> >
> >
> >
> > > On 05/02/2024 2:29 PM EDT Maria Jose Esteve <mj...@iest.com> wrote:
> > >
> > >
> > >
> > > Hi Mark,
> > >
> > > I don't know how the binding in Flex worked internally but if gp is null an error would surely occur, perhaps it was an internal error that was intercepted but...
> > >
> > > I can share with you how I do it, although I don't know if it is the best way:
> > >
> > > <ns7:CustomButtonBar id="topCBB"
> > > btnA="['Home','Statistics','Network','MCA Grid']"
> > > btnBoxA="{!gp?[]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> > > itemH="36"
> > > fntSz="16"/>
> > >
> > >
> > >
> > > Or
> > > btnBoxA="{!gp?null:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> > >
> > > Or
> > > btnBoxA="{!gp?[null,null,null,null]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> > >
> > >
> > >
> > > It depends on what works for you.
> > >
> > >
> > > Hiedra
> > >
> > > De: MARK HARTNETT <m_...@comcast.net>
> > > Enviado el: jueves, 2 de mayo de 2024 18:44
> > > Para: users@royale.apache.org
> > > Asunto: JS questions
> > >
> > >
> > >
> > > Hi all,
> > >
> > > All of my errors right now are null references.
> > >
> > >
> > >
> > > In this code gp.hpc crashes because hpc is null at this point.
> > >
> > > In Flex, I didn't care about that because once init() was done it was no longer null.
> > >
> > >
> > >
> > > <ns7:CustomButtonBar id="topCBB"
> > > btnA="['Home','Statistics','Network','MCA Grid']"
> > > btnBoxA="{[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> > > itemH="36"
> > > fntSz="16"/>
> > >
> > >
> > >
> > > With JS the null hpc throws an error.
> > >
> > > Moving those variables to creationComplete solves the problem.
> > >
> > >
> > >
> > > What is the difference with JS binding and Flex in terms of timing and object creation?
> > >
> > > Is there a a bead that allows nulls?
> > >
> > >
> > >
> > > Thanks
> > >
> > >
> > >
> > >
> > >
> >
>
Server setting
Posted by MARK HARTNETT <m_...@comcast.net>.
Hi all,
My db server is up and running on 8080 and I get CORS policy: No 'Access-Control-Allow-Origin' error on connection. I'm guessing this is a server setting but I haven't been able to find the solution.
Access to XMLHttpRequest at 'http://localhost:8080/rootmodel/securityCommand.flex?reqType=login&userId=randy&userPwd=steak' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Thanks
> On 05/04/2024 8:36 AM EDT MARK HARTNETT <m_...@comcast.net> wrote:
>
>
> Almost every error has been a null reference and Iv'e either moved the code to creationComplete or did as did as Maria said used ternary statements.
>
> The spark and mx comboBox always fails when the dataProvider is initially null. The JS checks to see if the labelField is blank and adds "label" as the labelField. (I think it's supposed to exit here)The the dp is accesed using the labelField and throws an error.
>
> I switched to the Jewel comboBox and all of the null errors disappeared but a lot of extra attribute errors. I have a lot of ComboBoxes with some special functionality so I extended the Jewel CB and added some attributes that get created as beads if not null. I did a global change from s:ComboBox to my extended CL:ComboBox, and the system opened login with no errors in the log.
>
> <j:ComboBox xmlns:fx="http://ns.adobe.com/mxml/2009"
> xmlns:j="library://ns.apache.org/royale/jewel">
>
> <fx:Script>
> <![CDATA[
> [Bindable]public var editable:Boolean = true;
> [Bindable]public var enabled:Boolean = true;
> [Bindable]public var selected:Boolean = true;
> [Bindable]public var restrict:String=null;
> ]]>
> </fx:Script>
> </j:ComboBox>
>
>
>
>
> > On 05/02/2024 2:29 PM EDT Maria Jose Esteve <mj...@iest.com> wrote:
> >
> >
> >
> > Hi Mark,
> >
> > I don't know how the binding in Flex worked internally but if gp is null an error would surely occur, perhaps it was an internal error that was intercepted but...
> >
> > I can share with you how I do it, although I don't know if it is the best way:
> >
> > <ns7:CustomButtonBar id="topCBB"
> > btnA="['Home','Statistics','Network','MCA Grid']"
> > btnBoxA="{!gp?[]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> > itemH="36"
> > fntSz="16"/>
> >
> >
> >
> > Or
> > btnBoxA="{!gp?null:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> >
> > Or
> > btnBoxA="{!gp?[null,null,null,null]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> >
> >
> >
> > It depends on what works for you.
> >
> >
> > Hiedra
> >
> > De: MARK HARTNETT <m_...@comcast.net>
> > Enviado el: jueves, 2 de mayo de 2024 18:44
> > Para: users@royale.apache.org
> > Asunto: JS questions
> >
> >
> >
> > Hi all,
> >
> > All of my errors right now are null references.
> >
> >
> >
> > In this code gp.hpc crashes because hpc is null at this point.
> >
> > In Flex, I didn't care about that because once init() was done it was no longer null.
> >
> >
> >
> > <ns7:CustomButtonBar id="topCBB"
> > btnA="['Home','Statistics','Network','MCA Grid']"
> > btnBoxA="{[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> > itemH="36"
> > fntSz="16"/>
> >
> >
> >
> > With JS the null hpc throws an error.
> >
> > Moving those variables to creationComplete solves the problem.
> >
> >
> >
> > What is the difference with JS binding and Flex in terms of timing and object creation?
> >
> > Is there a a bead that allows nulls?
> >
> >
> >
> > Thanks
> >
> >
> >
> >
> >
>
RE: JS questions
Posted by MARK HARTNETT <m_...@comcast.net>.
Almost every error has been a null reference and Iv'e either moved the code to creationComplete or did as did as Maria said used ternary statements.
The spark and mx comboBox always fails when the dataProvider is initially null. The JS checks to see if the labelField is blank and adds "label" as the labelField. (I think it's supposed to exit here)The the dp is accesed using the labelField and throws an error.
I switched to the Jewel comboBox and all of the null errors disappeared but a lot of extra attribute errors. I have a lot of ComboBoxes with some special functionality so I extended the Jewel CB and added some attributes that get created as beads if not null. I did a global change from s:ComboBox to my extended CL:ComboBox, and the system opened login with no errors in the log.
<j:ComboBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:j="library://ns.apache.org/royale/jewel">
<fx:Script>
<![CDATA[
[Bindable]public var editable:Boolean = true;
[Bindable]public var enabled:Boolean = true;
[Bindable]public var selected:Boolean = true;
[Bindable]public var restrict:String=null;
]]>
</fx:Script>
</j:ComboBox>
> On 05/02/2024 2:29 PM EDT Maria Jose Esteve <mj...@iest.com> wrote:
>
>
>
> Hi Mark,
>
> I don't know how the binding in Flex worked internally but if gp is null an error would surely occur, perhaps it was an internal error that was intercepted but...
>
> I can share with you how I do it, although I don't know if it is the best way:
>
> <ns7:CustomButtonBar id="topCBB"
> btnA="['Home','Statistics','Network','MCA Grid']"
> btnBoxA="{!gp?[]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> itemH="36"
> fntSz="16"/>
>
>
>
> Or
> btnBoxA="{!gp?null:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
>
> Or
> btnBoxA="{!gp?[null,null,null,null]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
>
>
>
> It depends on what works for you.
>
>
> Hiedra
>
> De: MARK HARTNETT <m_...@comcast.net>
> Enviado el: jueves, 2 de mayo de 2024 18:44
> Para: users@royale.apache.org
> Asunto: JS questions
>
>
>
> Hi all,
>
> All of my errors right now are null references.
>
>
>
> In this code gp.hpc crashes because hpc is null at this point.
>
> In Flex, I didn't care about that because once init() was done it was no longer null.
>
>
>
> <ns7:CustomButtonBar id="topCBB"
> btnA="['Home','Statistics','Network','MCA Grid']"
> btnBoxA="{[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
> itemH="36"
> fntSz="16"/>
>
>
>
> With JS the null hpc throws an error.
>
> Moving those variables to creationComplete solves the problem.
>
>
>
> What is the difference with JS binding and Flex in terms of timing and object creation?
>
> Is there a a bead that allows nulls?
>
>
>
> Thanks
>
>
>
>
>
RE: JS questions
Posted by Maria Jose Esteve <mj...@iest.com>.
Hi Mark,
I don't know how the binding in Flex worked internally but if gp is null an error would surely occur, perhaps it was an internal error that was intercepted but...
I can share with you how I do it, although I don't know if it is the best way:
<ns7:CustomButtonBar id="topCBB"
btnA="['Home','Statistics','Network','MCA Grid']"
btnBoxA="{!gp?[]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
itemH="36"
fntSz="16"/>
Or
btnBoxA="{!gp?null:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
Or
btnBoxA="{!gp?[null,null,null,null]:[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
It depends on what works for you.
Hiedra
De: MARK HARTNETT <m_...@comcast.net>
Enviado el: jueves, 2 de mayo de 2024 18:44
Para: users@royale.apache.org
Asunto: JS questions
Hi all,
All of my errors right now are null references.
In this code gp.hpc crashes because hpc is null at this point.
In Flex, I didn't care about that because once init() was done it was no longer null.
<ns7:CustomButtonBar id="topCBB"
btnA="['Home','Statistics','Network','MCA Grid']"
btnBoxA="{[gp.hpc, gp.statisticsCtrl, gp.siteNetworkCtrl, gp.dgBOX]}"
itemH="36"
fntSz="16"/>
With JS the null hpc throws an error.
Moving those variables to creationComplete solves the problem.
What is the difference with JS binding and Flex in terms of timing and object creation?
Is there a a bead that allows nulls?
Thanks