You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by xenia1234 <mw...@healthpi.com.au> on 2016/08/31 02:00:40 UTC

FlexJS Storage

Hi Guys,

I need to read a csv file from FlexJS application. I found these two class
in the Storage.swc called LocalStorage and PermanentStorage. 

Would you please show me the difference between these two and if possible,
Could you also give me a quick example on how to use both class?

thank you





--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Storage-tp13475.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: FlexJS Storage

Posted by xenia1234 <mw...@healthpi.com.au>.
Thanks Alex.

It worked perfectly. 



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Storage-tp13475p13489.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: FlexJS Storage

Posted by Alex Harui <ah...@adobe.com>.
Instead of URLLoader, use org.apache.flex.network.HTTPService.

Set the url, call send(), when the COMPLETE event is fired, the data
property should hold your CSV file.

HTH,
-Alex

On 8/31/16, 9:56 PM, "xenia1234" <mw...@healthpi.com.au> wrote:

>But how do you read it ?
>
>Flex SDK has URLLoader.
>In FlexJS, there is no URLLoader to read the data.
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Storage-tp13475p1348
>6.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: FlexJS Storage

Posted by xenia1234 <mw...@healthpi.com.au>.
Okay, I can try that.
Thank you so much for your help.
I am newbie in FlexJS. Just trying to get my head around it. 



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Storage-tp13475p13488.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: FlexJS Storage

Posted by xenia1234 <mw...@healthpi.com.au>.
But how do you read it ? 

Flex SDK has URLLoader. 
In FlexJS, there is no URLLoader to read the data. 



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Storage-tp13475p13486.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: FlexJS Storage

Posted by Alex Harui <ah...@adobe.com>.

On 8/31/16, 9:36 PM, "xenia1234" <mw...@healthpi.com.au> wrote:

>Hi Alex,
>
>Its a csv data file stored on the server. In this case, how can I load the
>csv file? Which components should I use?
>

I would think you could use HTTPService to load a CSV text file.  Did you
try that?

-Alex


Re: FlexJS Storage

Posted by xenia1234 <mw...@healthpi.com.au>.
Hi Alex,

Its a csv data file stored on the server. In this case, how can I load the
csv file? Which components should I use? 



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Storage-tp13475p13484.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: FlexJS Storage

Posted by Alex Harui <ah...@adobe.com>.

On 8/31/16, 4:24 PM, "xenia1234" <mw...@healthpi.com.au> wrote:

>I am using browser. So Can I still use this Permanent storage and how?

Probably not the Cordova-dependent storage providers.  Where is the XLS
file located?  Browsers generally don't have access to the file system.

-Alex


Re: FlexJS Storage

Posted by xenia1234 <mw...@healthpi.com.au>.
I am using browser. So Can I still use this Permanent storage and how?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Storage-tp13475p13482.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: FlexJS Storage

Posted by Alex Harui <ah...@adobe.com>.
Peter wrote these examples.  I think they require Cordova by default but
different providers can do different things.

Are you building a browser app, desktop app, or mobile app?
-Alex

On 8/30/16, 9:25 PM, "xenia1234" <mw...@healthpi.com.au> wrote:

>I found the storage JS example. However, when I debug it, it throw error
>in
>my chrome consoleError:*Starting up*WebStorageProvider.js:235 Uncaught
>ReferenceError: cordova is not definedWebStorageProvider.js:136 Uncaught
>ReferenceError: cordova is not definedWebStorageProvider.js:202 Uncaught
>ReferenceError: cordova is not definedWebStorageProvider.js:136 Uncaught
>ReferenceError: cordova is not definedWebStorageProvider.js:94 Uncaught
>ReferenceError: cordova is not defined*code throw exception:* var /**
>@type
>{string} */ fullPath = String(cordova["file"]["dataDirectory"]) +
>fileName; 
>window.resolveLocalFileSystemURL(cordova.file.dataDirectory,
>__localFn0__);
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Storage-tp13475p1347
>6.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: FlexJS Storage

Posted by xenia1234 <mw...@healthpi.com.au>.
I found the storage JS example. However, when I debug it, it throw error in
my chrome consoleError:*Starting up*WebStorageProvider.js:235 Uncaught
ReferenceError: cordova is not definedWebStorageProvider.js:136 Uncaught
ReferenceError: cordova is not definedWebStorageProvider.js:202 Uncaught
ReferenceError: cordova is not definedWebStorageProvider.js:136 Uncaught
ReferenceError: cordova is not definedWebStorageProvider.js:94 Uncaught
ReferenceError: cordova is not defined*code throw exception:* var /** @type
{string} */ fullPath = String(cordova["file"]["dataDirectory"]) + fileName; 
window.resolveLocalFileSystemURL(cordova.file.dataDirectory, __localFn0__);



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-Storage-tp13475p13476.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.