You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by wkoch <wa...@boeing.com> on 2020/09/29 11:31:12 UTC

How do I convert complex JSON to an ArrayList?

This is my first try at using JSON and I can't seem to get it right.  I'm
using the example at
https://royale.apache.org/loading-external-data-through-httpservice/ as a
starting point but changed it to use a Cold Fusion CFC I converted to a JSON
web service(access="remote" returntype="Any" returnformat="JSON").  I'm
getting back complex JSON data oth two items that looks like this:

{"STATUS":"SUCCESS","PROGRAMS":[{"MDL_NO":"03","MDL_NM":"3"},{"MDL_NO":"04","MDL_NM":"4,5,6"},{"MDL_NO":"07","MDL_NM":"7"}]}

It shows up fine in the alert  (Alert.show(service.jsonToString, "JSON
data");)

I can extract the STATUS no problem (service.json.STATUS)

The PROGRAMS is the result of a database query.  What I need to do is put
PROGRAMS in an ArrayList so I can use it as a data provider on lists. I
can't seem to convert it to an ArrayList- How do I do that?





--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: How do I convert complex JSON to an ArrayList?

Posted by Carlos Rovira <ca...@apache.org>.
About the debug vs release differences.
On Applications we didn't detect anyone lately. We have a problem right now
on Modules that we are trying to solve.
So if you see something wrong please open other different thread and
explain your findings
thanks

RE: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?

Posted by "Koch (US), Warren R" <wa...@boeing.com>.
That fixed it.  Now on to try and get a List to work with the arraylist.

From: Carlos Rovira [mailto:carlosrovira@apache.org]
Sent: Wednesday, September 30, 2020 10:26 AM
To: users@royale.apache.org
Subject: Re: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?


This message was sent from outside of Boeing. Please do not click links or open attachments unless you recognize the sender and know that the content is safe.




Also more info about it in royale docs here:

https://apache.github.io/royale-docs/create-an-application/optimizations/compiler-configuration-settings.html#dynamic-access-unknown-members

El mié., 30 sept. 2020 a las 17:23, Carlos Rovira (<ca...@apache.org>>) escribió:
Hi Warren,

you probably are missing the following compiler option:

-js-dynamic-access-unknown-members=true;

to access JSON subobject graphs in release mode

Let us know if that solves the problem

Thanks

El mié., 30 sept. 2020 a las 13:35, wkoch (<wa...@boeing.com>>) escribió:
I used both the 0.9.7 and the 0.9.8 build ( I pulled that down yesterday ). I
am attaching a file of the source code and console output from the debug and
release builds using 0.9.8.

It fails in both builds.  In the IE inspector I get:

Unable to get property 'Ng' of undefined or null reference
JewelExampleJS.mxml (33,4)

which in the source code is

label_parse.text=myArrayList[2].MDL_NM;

JewelExampleJS.txt
<http://apache-royale-users.20374.n8.nabble.com/file/t177/JewelExampleJS.txt>



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


--
Carlos Rovira
http://about.me/carlosrovira



--
Carlos Rovira
http://about.me/carlosrovira


Re: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?

Posted by Carlos Rovira <ca...@apache.org>.
Also more info about it in royale docs here:

https://apache.github.io/royale-docs/create-an-application/optimizations/compiler-configuration-settings.html#dynamic-access-unknown-members

El mié., 30 sept. 2020 a las 17:23, Carlos Rovira (<ca...@apache.org>)
escribió:

> Hi Warren,
>
> you probably are missing the following compiler option:
>
> -js-dynamic-access-unknown-members=true;
>
> to access JSON subobject graphs in release mode
>
> Let us know if that solves the problem
>
> Thanks
>
> El mié., 30 sept. 2020 a las 13:35, wkoch (<wa...@boeing.com>)
> escribió:
>
>> I used both the 0.9.7 and the 0.9.8 build ( I pulled that down yesterday
>> ). I
>> am attaching a file of the source code and console output from the debug
>> and
>> release builds using 0.9.8.
>>
>> It fails in both builds.  In the IE inspector I get:
>>
>> Unable to get property 'Ng' of undefined or null reference
>> JewelExampleJS.mxml (33,4)
>>
>> which in the source code is
>>
>> label_parse.text=myArrayList[2].MDL_NM;
>>
>> JewelExampleJS.txt
>> <
>> http://apache-royale-users.20374.n8.nabble.com/file/t177/JewelExampleJS.txt>
>>
>>
>>
>>
>> --
>> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

you probably are missing the following compiler option:

-js-dynamic-access-unknown-members=true;

to access JSON subobject graphs in release mode

Let us know if that solves the problem

Thanks

El mié., 30 sept. 2020 a las 13:35, wkoch (<wa...@boeing.com>)
escribió:

> I used both the 0.9.7 and the 0.9.8 build ( I pulled that down yesterday
> ). I
> am attaching a file of the source code and console output from the debug
> and
> release builds using 0.9.8.
>
> It fails in both builds.  In the IE inspector I get:
>
> Unable to get property 'Ng' of undefined or null reference
> JewelExampleJS.mxml (33,4)
>
> which in the source code is
>
> label_parse.text=myArrayList[2].MDL_NM;
>
> JewelExampleJS.txt
> <
> http://apache-royale-users.20374.n8.nabble.com/file/t177/JewelExampleJS.txt>
>
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?

Posted by wkoch <wa...@boeing.com>.
I used both the 0.9.7 and the 0.9.8 build ( I pulled that down yesterday ). I
am attaching a file of the source code and console output from the debug and
release builds using 0.9.8.

It fails in both builds.  In the IE inspector I get:

Unable to get property 'Ng' of undefined or null reference
JewelExampleJS.mxml (33,4)

which in the source code is 

label_parse.text=myArrayList[2].MDL_NM;

JewelExampleJS.txt
<http://apache-royale-users.20374.n8.nabble.com/file/t177/JewelExampleJS.txt>  



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?

Posted by Piotr Zarzycki <pi...@gmail.com>.
Warren,

Just to make clear here - if something doesn't work in release mode it is
possible that is issue in Royale compiler. In order to chase it we need
extracted working example/code and maybe zipped build - raise issue on
GitHub.

This is definitely not an issue in Moonshine itself.

Please use Nightly build - do you use?

Thanks,
Piotr

On Wed, Sep 30, 2020, 2:36 AM wkoch <wa...@boeing.com> wrote:

> I changed my code like this based on what you folks indicated.
>
> public var myObj:Object;
> public var myArrayList:ArrayList;
>
> private function appInit():void{
>         registerClassAlias('org.apache.royale.collections.ArrayList',
> ArrayList);
> }
> private function resultCallback(event:Event):void{
>  label_status.text =  daveservice.json.STATUS;
>  label_all.text = daveservice.data;
>  label_pgm.text =  daveservice.json.PROGRAMS[1].MDL_CONCAT;
>  myObj = JSON.parse(daveservice.data);
>  myArrayList = new ArrayList(myObj.PROGRAMS);
>  label_parse.text=myArrayList[2].MDL_CONCAT;
> }
>
> The label_parse got the right text so it appears I'm making progress.  I'd
> be interested in learning about those "ways".
>
> Now the only issue is the Moonshine one -- debug version works on the
> server.  The release doesn't
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>

Re: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?

Posted by wkoch <wa...@boeing.com>.
I changed my code like this based on what you folks indicated.

public var myObj:Object;
public var myArrayList:ArrayList;

private function appInit():void{
	registerClassAlias('org.apache.royale.collections.ArrayList', ArrayList);
}
private function resultCallback(event:Event):void{
 label_status.text =  daveservice.json.STATUS;
 label_all.text = daveservice.data;
 label_pgm.text =  daveservice.json.PROGRAMS[1].MDL_CONCAT;
 myObj = JSON.parse(daveservice.data);
 myArrayList = new ArrayList(myObj.PROGRAMS);
 label_parse.text=myArrayList[2].MDL_CONCAT;
}

The label_parse got the right text so it appears I'm making progress.  I'd
be interested in learning about those "ways".  

Now the only issue is the Moonshine one -- debug version works on the
server.  The release doesn't



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?

Posted by Greg Dove <gr...@gmail.com>.
Normally for ArrayList, all you have to do is

var myArrayList:ArrayList = new ArrayList(mySourceArray);

if daveservice.json.PROGRAMS is an Array, then presumably you could use
that.

But with untyped objects, you may have issues in release build with
renaming if you also try to access the fields with string access (e.g.
myProgramInstance["MDL_NO"] ). There are ways to address that....



On Wed, Sep 30, 2020 at 11:25 AM wkoch <wa...@boeing.com> wrote:

> So I guess I'd better pay more attention to my post.  For some reason the
> SCRIPT got pulled when I posted it.  No wonder I was getting questions.
> Apologies.
>
> I'm trying to get daveservice.json.PROGRAMS into an arraylist.
>
> <fx:Script>
>         import org.apache.royale.events.Event;
>         import org.apache.royale.events.MouseEvent;
>         import org.apache.royale.jewel.Alert;
>         import org.apache.royale.net.HTTPConstants;
>         import org.apache.royale.net.HTTPService;
>         import org.apache.royale.net.URLVariables;
>
>         public var daveservice:HTTPService = new HTTPService();
>
>         private function resultCallback(event:Event):void{
>                 Alert.show("STATUS: " + daveservice.json.STATUS, "json data
> retrieved");
>                 Alert.show("string format: " + daveservice.data, "what");
>                 Alert.show("MDL_CONCAT: "+
> daveservice.json.PROGRAMS[1].MDL_CONCAT, "json
> data retrieved");
>         }
>
>         public function getCfcStoredProcContent(event:Event):void{
>                 daveservice.url
> ="/MIS_Lists.cfc?method=websitelistspkg_TailnumberList_json";
>                 daveservice.method = HTTPConstants.GET;
>                 daveservice.addEventListener("complete", resultCallback);
>                 daveservice.send();
>         }
> </fx:Script>
>
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>

Re: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?

Posted by wkoch <wa...@boeing.com>.
So I guess I'd better pay more attention to my post.  For some reason the
SCRIPT got pulled when I posted it.  No wonder I was getting questions. 
Apologies.

I'm trying to get daveservice.json.PROGRAMS into an arraylist.

<fx:Script>
        import org.apache.royale.events.Event;
        import org.apache.royale.events.MouseEvent;
        import org.apache.royale.jewel.Alert;
        import org.apache.royale.net.HTTPConstants;
        import org.apache.royale.net.HTTPService;
        import org.apache.royale.net.URLVariables;
       
        public var daveservice:HTTPService = new HTTPService();
       
        private function resultCallback(event:Event):void{
                Alert.show("STATUS: " + daveservice.json.STATUS, "json data
retrieved");
                Alert.show("string format: " + daveservice.data, "what");
                Alert.show("MDL_CONCAT: "+
daveservice.json.PROGRAMS[1].MDL_CONCAT, "json
data retrieved");
        }

        public function getCfcStoredProcContent(event:Event):void{
                daveservice.url
="/MIS_Lists.cfc?method=websitelistspkg_TailnumberList_json";
                daveservice.method = HTTPConstants.GET;
                daveservice.addEventListener("complete", resultCallback);
                daveservice.send();
        }
</fx:Script>




--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?

Posted by Piotr Zarzycki <pi...@gmail.com>.
Definitely try to use Nightly - you have an easy way of download Nightly
trough installer - do you have drop down list there ?

wt., 29 wrz 2020 o 20:50 Koch (US), Warren R <wa...@boeing.com>
napisał(a):

> The button click was just a way fire the webservice and see some data.  I
> want to flesh out the callback with an array list which I then will use as
> a data provider to a grid or list.  I'm moving very slowly here…
>
>
>
> I didn't use the nightly build as there was a warning on the web site not
> to use in for production applications.
>
>
>
> *From:* Carlos Rovira [mailto:carlosrovira@apache.org]
> *Sent:* Tuesday, September 29, 2020 1:42 PM
> *To:* users@royale.apache.org
> *Subject:* [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?
>
>
>
> This message was sent from outside of Boeing. Please do not click links or
> open attachments unless you recognize the sender and know that the content
> is safe.
>
>
>
>
> Hi Warren,
>
>
>
> The problem with the code you posted is that it is only UI, the crucial
> parts are the objects you use to get the data (I guess the button click).
>
>
>
> Also, why don't you use a nightly? I think 0.9.7 start to be a bit old
> (check at the end of this url: https://royale.apache.org/get-involved/)
>
>
>
> Thanks
>
>
>
>
>
>
>
> El mar., 29 sept. 2020 a las 20:32, wkoch (<wa...@boeing.com>)
> escribió:
>
>
> I've simplified the code a whole bunch to make it easier (for me!) to
> understand.  I've tried a bunch of things but took it all out going on the
> assumption you wizards could modify this faster to add an ArrayList rather
> than try and clean up my mess.  FYI -- I'm using 0.9.7 with Moonshine 3.0.0
> build 234.
>
> <?xml version="1.0" encoding="utf-8"?>
> <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>                            xmlns:j="library://ns.apache.org/royale/jewel"
>                            xmlns:js="library://ns.apache.org/royale/basic"
>
>                            xmlns:html="library://ns.apache.org/royale/html
> "
>                            xmlns:local="*">
>         <fx:Style source="resources/app-styles.css"/>
>     <fx:Script>
>
>     </fx:Script>
>         <j:valuesImpl>
>                 <js:SimpleCSSValuesImpl />
>         </j:valuesImpl>
>     <j:initialView>
>         <j:View>
>             <j:beads>
>                 <j:VerticalCenteredLayout/>
>             </j:beads>
>                     <j:Button text="Get Data 2" emphasis="primary"
> click="getCfcStoredProcContent(event)" />
>         </j:View>
>     </j:initialView>
> </j:Application>
>
>
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>
>
>
>
> --
>
> Carlos Rovira
>
> http://about.me/carlosrovira
>
>
>


-- 

Piotr Zarzycki

RE: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?

Posted by "Koch (US), Warren R" <wa...@boeing.com>.
The button click was just a way fire the webservice and see some data.  I want to flesh out the callback with an array list which I then will use as a data provider to a grid or list.  I'm moving very slowly here…

I didn't use the nightly build as there was a warning on the web site not to use in for production applications.

From: Carlos Rovira [mailto:carlosrovira@apache.org]
Sent: Tuesday, September 29, 2020 1:42 PM
To: users@royale.apache.org
Subject: [EXTERNAL] Re: How do I convert complex JSON to an ArrayList?


This message was sent from outside of Boeing. Please do not click links or open attachments unless you recognize the sender and know that the content is safe.




Hi Warren,

The problem with the code you posted is that it is only UI, the crucial parts are the objects you use to get the data (I guess the button click).

Also, why don't you use a nightly? I think 0.9.7 start to be a bit old (check at the end of this url: https://royale.apache.org/get-involved/)

Thanks



El mar., 29 sept. 2020 a las 20:32, wkoch (<wa...@boeing.com>>) escribió:

I've simplified the code a whole bunch to make it easier (for me!) to
understand.  I've tried a bunch of things but took it all out going on the
assumption you wizards could modify this faster to add an ArrayList rather
than try and clean up my mess.  FYI -- I'm using 0.9.7 with Moonshine 3.0.0
build 234.

<?xml version="1.0" encoding="utf-8"?>
<j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:j="library://ns.apache.org/royale/jewel<http://ns.apache.org/royale/jewel>"
                           xmlns:js="library://ns.apache.org/royale/basic<http://ns.apache.org/royale/basic>"
                           xmlns:html="library://ns.apache.org/royale/html<http://ns.apache.org/royale/html>"
                           xmlns:local="*">
        <fx:Style source="resources/app-styles.css"/>
    <fx:Script>

    </fx:Script>
        <j:valuesImpl>
                <js:SimpleCSSValuesImpl />
        </j:valuesImpl>
    <j:initialView>
        <j:View>
            <j:beads>
                <j:VerticalCenteredLayout/>
            </j:beads>
                    <j:Button text="Get Data 2" emphasis="primary"
click="getCfcStoredProcContent(event)" />
        </j:View>
    </j:initialView>
</j:Application>





--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


--
Carlos Rovira
http://about.me/carlosrovira


Re: How do I convert complex JSON to an ArrayList?

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

The problem with the code you posted is that it is only UI, the crucial
parts are the objects you use to get the data (I guess the button click).

Also, why don't you use a nightly? I think 0.9.7 start to be a bit old
(check at the end of this url: https://royale.apache.org/get-involved/)

Thanks



El mar., 29 sept. 2020 a las 20:32, wkoch (<wa...@boeing.com>)
escribió:

>
> I've simplified the code a whole bunch to make it easier (for me!) to
> understand.  I've tried a bunch of things but took it all out going on the
> assumption you wizards could modify this faster to add an ArrayList rather
> than try and clean up my mess.  FYI -- I'm using 0.9.7 with Moonshine 3.0.0
> build 234.
>
> <?xml version="1.0" encoding="utf-8"?>
> <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>                            xmlns:j="library://ns.apache.org/royale/jewel"
>                            xmlns:js="library://ns.apache.org/royale/basic"
>
>                            xmlns:html="library://ns.apache.org/royale/html
> "
>                            xmlns:local="*">
>         <fx:Style source="resources/app-styles.css"/>
>     <fx:Script>
>
>     </fx:Script>
>         <j:valuesImpl>
>                 <js:SimpleCSSValuesImpl />
>         </j:valuesImpl>
>     <j:initialView>
>         <j:View>
>             <j:beads>
>                 <j:VerticalCenteredLayout/>
>             </j:beads>
>                     <j:Button text="Get Data 2" emphasis="primary"
> click="getCfcStoredProcContent(event)" />
>         </j:View>
>     </j:initialView>
> </j:Application>
>
>
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: How do I convert complex JSON to an ArrayList?

Posted by Piotr Zarzycki <pi...@gmail.com>.
Hi Warren,

I'm not exactly sure what do you wanted to achieve. If you have JSON string
you can do:

*JSON.parse()*

If there is an array you will get object with Array it means that if you
have:

 {"STATUS":"SUCCESS","PROGRAMS":[{"MDL_NO":"03","MDL_NM":"3"},{"MDL_NO":"04","MDL_NM":"4,5,6"},{"MDL_NO":"07","MDL_NM":"7"}]}

Doing JSON.parse on above you will get object:

var myObj:Object = {
    PROGRAMS: [ ]
}

It means you can later do new ArrayList(myObj.PROGRAMS).

wt., 29 wrz 2020 o 20:32 wkoch <wa...@boeing.com> napisał(a):

>
> I've simplified the code a whole bunch to make it easier (for me!) to
> understand.  I've tried a bunch of things but took it all out going on the
> assumption you wizards could modify this faster to add an ArrayList rather
> than try and clean up my mess.  FYI -- I'm using 0.9.7 with Moonshine 3.0.0
> build 234.
>
> <?xml version="1.0" encoding="utf-8"?>
> <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>                            xmlns:j="library://ns.apache.org/royale/jewel"
>                            xmlns:js="library://ns.apache.org/royale/basic"
>
>                            xmlns:html="library://ns.apache.org/royale/html
> "
>                            xmlns:local="*">
>         <fx:Style source="resources/app-styles.css"/>
>     <fx:Script>
>
>     </fx:Script>
>         <j:valuesImpl>
>                 <js:SimpleCSSValuesImpl />
>         </j:valuesImpl>
>     <j:initialView>
>         <j:View>
>             <j:beads>
>                 <j:VerticalCenteredLayout/>
>             </j:beads>
>                     <j:Button text="Get Data 2" emphasis="primary"
> click="getCfcStoredProcContent(event)" />
>         </j:View>
>     </j:initialView>
> </j:Application>
>
>
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 

Piotr Zarzycki

Re: How do I convert complex JSON to an ArrayList?

Posted by wkoch <wa...@boeing.com>.
I've simplified the code a whole bunch to make it easier (for me!) to
understand.  I've tried a bunch of things but took it all out going on the
assumption you wizards could modify this faster to add an ArrayList rather
than try and clean up my mess.  FYI -- I'm using 0.9.7 with Moonshine 3.0.0
build 234.

<?xml version="1.0" encoding="utf-8"?>
<j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
			   xmlns:j="library://ns.apache.org/royale/jewel"
			   xmlns:js="library://ns.apache.org/royale/basic" 
			   xmlns:html="library://ns.apache.org/royale/html"
			   xmlns:local="*">
	<fx:Style source="resources/app-styles.css"/>
    <fx:Script>
    
    </fx:Script>
	<j:valuesImpl>
		<js:SimpleCSSValuesImpl />
	</j:valuesImpl>
    <j:initialView>
        <j:View>
            <j:beads>
                <j:VerticalCenteredLayout/>
            </j:beads>
                    <j:Button text="Get Data 2" emphasis="primary"
click="getCfcStoredProcContent(event)" />
        </j:View>
    </j:initialView>
</j:Application>





--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: How do I convert complex JSON to an ArrayList?

Posted by Carlos Rovira <ca...@apache.org>.
Hi Warren,

we'll need the code you're using in order to help you.
You said you're using the code from the blog example right? but you changed
something and it is not working right.
Better posting a snippet that shows us how you're doing it. Some of the
times people uses other packages or classes, but we can only detect seeing
more code

thanks


El mar., 29 sept. 2020 a las 18:43, wkoch (<wa...@boeing.com>)
escribió:

> I've done some more simple testing and I'm finding the Moonshine Debug
> build
> works differently than the Release build.  Which is worrisome
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: How do I convert complex JSON to an ArrayList?

Posted by wkoch <wa...@boeing.com>.
I've done some more simple testing and I'm finding the Moonshine Debug build
works differently than the Release build.  Which is worrisome



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: How do I convert complex JSON to an ArrayList?

Posted by Andrew Wetmore <an...@apache.org>.
Hi, Warren:

This is pretty straightforward; however a lot of Royale folks are at
ApacheCon today and for the next two days. You may not get a response until
later in the week.

Andrew

On Tue, Sep 29, 2020 at 8:31 AM wkoch <wa...@boeing.com> wrote:

>
> This is my first try at using JSON and I can't seem to get it right.  I'm
> using the example at
> https://royale.apache.org/loading-external-data-through-httpservice/ as a
> starting point but changed it to use a Cold Fusion CFC I converted to a
> JSON
> web service(access="remote" returntype="Any" returnformat="JSON").  I'm
> getting back complex JSON data oth two items that looks like this:
>
>
> {"STATUS":"SUCCESS","PROGRAMS":[{"MDL_NO":"03","MDL_NM":"3"},{"MDL_NO":"04","MDL_NM":"4,5,6"},{"MDL_NO":"07","MDL_NM":"7"}]}
>
> It shows up fine in the alert  (Alert.show(service.jsonToString, "JSON
> data");)
>
> I can extract the STATUS no problem (service.json.STATUS)
>
> The PROGRAMS is the result of a database query.  What I need to do is put
> PROGRAMS in an ArrayList so I can use it as a data provider on lists. I
> can't seem to convert it to an ArrayList- How do I do that?
>
>
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>


-- 
Andrew Wetmore
Technical Writer-Editor
Infra
*Apache Software Foundation*
andreww@apache.org