Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: saving form (text input) to show in other state

If you are not deleting/destroying an object, text within a TextInput will remain there unless you explicitly remove it or it gets reinitialized.

New Developer
alexperri7
Posts: 325
Registered: ‎10-28-2010
My Device: Blackberry Bold 9900

Re: saving form (text input) to show in other state

I just tried in the simulator and it goes away once the app is closed and reopened. Is there a way to make it remain upon reloading the app? I think the user would get a little annoyed having to input all their information everytime they opened the app.

---------------------------------
My PlayBook Apps: Pocket Portrait Lighting, Pocket Food Photography, Allergen Free Cooking, Easy Agenda
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: saving form (text input) to show in other state

You have to persist the data to a file or other persistent data store and then read it back in when the application starts up.  Data in memory will be gone once the applicatin quits.  There are lots of threads that covers preference information (XML and SharedObjects).  Larger sets of data can be stored in SQLite database engine.

New Developer
alexperri7
Posts: 325
Registered: ‎10-28-2010
My Device: Blackberry Bold 9900

Re: saving form (text input) to show in other state

For some reason it seems like I'm just not finding what I'm looking for. I just looked into the whole SQL database, XML and SharedObjects methods, but it seems like those are all for creating data grids. If you look at the image below, you will see exactly what I want. I want that screen to remain with the filled in information, once the save button is clicked. Although I have no knowledge of any of those things previously mentioned, it just doesn't seem like its what I'm trying to do in mxml.

 

Screen shot 2011-02-15 at 4.33.52 PM.png

---------------------------------
My PlayBook Apps: Pocket Portrait Lighting, Pocket Food Photography, Allergen Free Cooking, Easy Agenda
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: saving form (text input) to show in other state

To do what we discussed, you have to write Action Script.  MXML is mainly for GUI layout.  You can add the Action Script in the script section of the MXML code.

New Developer
alexperri7
Posts: 325
Registered: ‎10-28-2010
My Device: Blackberry Bold 9900

Re: saving form (text input) to show in other state

Thanks for all the help John, I appreciate it. I'll try and see what I can do.

---------------------------------
My PlayBook Apps: Pocket Portrait Lighting, Pocket Food Photography, Allergen Free Cooking, Easy Agenda
Developer
JohnPinkerton
Posts: 350
Registered: ‎01-21-2011
My Device: Curve 8900 (Personal) / Bold 9650 (Work)

Re: saving form (text input) to show in other state

I wonder if you shouldn't try saving it as an XML file, rather than attempting to save it in an SQL database.

 

Though you could save it to an SQL database and have it propagate the information into the labels.

Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: saving form (text input) to show in other state

[ Edited ]

@alex: when i started out using SQLite, there was little to no information about it online. now there is a little more but it might not suffice. so if you have any questions relating to it, be sure to post your attempts and we'll be more than happy to guide you along with it.

 

that being said i highly recommend you look into the FullRSSReader example that RIM created a while back if you do decide to take the SQLite route. the app itself may not work (due to API changes since), but the concepts are still there and are super valuable. here is a thread that you can download the sample from:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Any-more-sample-code-besides-quot...

 

good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
New Developer
alexperri7
Posts: 325
Registered: ‎10-28-2010
My Device: Blackberry Bold 9900

Re: saving form (text input) to show in other state

@Jrab,

 

Thanks for the info! Thats like the fifth time in the past couple of days you've helped me. The question I have now is how do I open that file? It tried to open in adobe catalyst and it said it couldn't open because something has been modified outside of catalyst.

---------------------------------
My PlayBook Apps: Pocket Portrait Lighting, Pocket Food Photography, Allergen Free Cooking, Easy Agenda
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: saving form (text input) to show in other state

hey alex,

 

no problem at all! just pump out those apps haha

 

as for the file, which one did you try to download and open? if you are using FB4 i recommend the first one. you should be able to Import it via File > Import Flash Builder Project from the menu and navigating to your download location.

 

if you are using burrito i recommend you download the second link i posted in that same thread (attached to the post):

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Any-more-sample-code-besides-quot...

 

this one is a zip file instead of a standard Flash Builder Burrito project. in it you will find a directory called src and under it are all the source files from the project.

 

so once you have downloaded that one, simply go to Burrito and navigate to:

 

File > Import Flash Builder Project

 

Then hit browse and look for the .zip file you just downloaded. once you hit next you will see a new menu with options. the default should be to import a new copy. Then just hit finish and your project should now be imported albeit not working because of it being incompatible with the newer SDK as stated int he previous post.

 

So the thing to remember is to manually import the .zip file (second link) using Burrito.

 

hope that works. good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman