Wednesday, September 7, 2011

Flex mobile shared object data storage

If you are developing a mobile application & you might want to store the data globally so that you can access from the different views.

Using PersistenceManager we can achieve this. We can use the PersistenceManager which stores the data by using key value.


var persistenceManager:PersistenceManager = new PersistenceManager();
persistenceManager.setProperty("dataURL","http://google.com");
persistenceManager.getProperty("dataURL");

Spark multi column form control

Using nested FormItem we can achieve multi column form control in flex spark form component.


The above figure shows the multi column spark form.

Attached the code below.

Robotlegs - Accessing a view's objects from another view

 We can not directly access a view's object from another view mediator.

To achieve this, we need to dispatch the events & then access the view's objects from another view.

You can not inject a view object in another view mediator & access.

Sample:

I have a MainView which has viewstack consisting of 3 childs (1.UserScreen 2.ProjectsScreen 3.ConfigScreen)

Now i am in ProjectsScreen & on click of a button, want to display the UserScreen by changing the viewstack index on MainView.

In ProjectsScreenMediator you can inject MainScreen view & then change the ViewStack selectedIndex.

Related Posts Plugin for WordPress, Blogger...