Here is the code for the getter and setter: 

public  static var __workflowState : Number;    
public static function get workflowState():Number
        {
        return __workflowState;
        }

        public static function set
workflowState(myNumber:Number):Void
        {
        //ContextManager is a class used to store data
in a SharedObject
        ContextManager.setContext("workflowState",myNumber);
        __workflowState=myNumber;
        }



The getMainView function managing the viewStack: 

public function getMainView( workflowState : Number )
: UIComponent
   {

        if( workflowState ==
ProtoFlexModelLocator.VIEWING_MAIN_HOME )
        {
                return view.home;
        }
        else if( workflowState ==
ProtoFlexModelLocator.VIEWING_MAIN_OFFERS )
        {
                return view.offers;
        }
        else if( workflowState ==
ProtoFlexModelLocator.VIEWING_MAIN_HANDSETS_IN_GRID )
        {
                return view.handsets;
        }
        else if( workflowState ==
ProtoFlexModelLocator.VIEWING_MAIN_PLANS )
        {
                return view.plans;
        }
        else if( workflowState ==
ProtoFlexModelLocator.VIEWING_MAIN_ACCESSORIES )
        {
                return view.accessories;
        }
   }



And, for example, a Command i use to navigate through
the viewStack : 


        public function execute( event : Event ):Void
        {       
                ProtoFlexModelLocator.workflowState =
ProtoFlexModelLocator.VIEWING_MAIN_OFFERS;

                ProtoFlexModelLocator.workflowStateAction =
ProtoFlexModelLocator.VIEWING_ACTION_OFFER_DESCRIPTION;
                
        }




Subsidiary Question : 
I want to save a complex data  (an array of custom
Object)
onto a SharedObject. 
How can i do that since it seems that when i call back
the data, the array contains null data?

Thanks a lot for you help.




--- Dimitrios Gianninas
<[EMAIL PROTECTED]> a écrit :

> Hi,
>  
> Can you share with us the code behind the get/set
> methods of
> workflowState ? Also have you added some trace
> output to see if it
> really isn't being called.
>  
> Dimitrios "Jimmy" Gianninas
> RIA Developer
> Optimal Payments Inc.
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED] On
> Behalf Of antonin34
> Sent: Monday, January 23, 2006 9:32 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Saving modelLocator variable
> in sharedObject?
> 
> 
> 
> Hi,
> 
>  
> 
> We are currently developing a Flex prototype using
> the cairngorm
> framework.
> 
> To manage the different pages of our application, we
> use a viewStack
> whose index is managed via a binding on a
> "getMainView" function : 
> 
>  
> 
> <mx:ViewStack
> xmlns:mx=http://macromedia.com/2003/mxml
> xmlns:view="com.protoflex.view.*"
> selectedChild="{applicationViewHelper.getMainView(
> ProtoFlexModelLocator.workflowState);}" >
> 
>  
> 
>  
> 
> This function use a model locator variable
> (ProtoFlexModelLocator.workflowState) to return the
> right view to the
> viewStack.
> 
> Everything goes well until..
> 
> Here is my problem : I'm trying to save the
> workflowState to a
> SharedObject so the user will come back to the
> currently visited page if
> he quit and come back later.
> 
> To do so, i have made a public function get
> workflowState() and a public
> function set workflowState() so everytime the
> workflowState is changed,
> i stock it in a SharedObject. But now, it seems that
> the ViewStack is no
> more working, as if the getMainView function doesn't
> trigger when the
> workflowState change.
> 
>  
> 
> Can you help me on this, or give me some clue on how
> to save a client
> context of a flex application?
> 
>  
> 
> Thanks a lot,
> 
> Regards
> 
>  
> 
> Antoine
> 
>  
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ:
>
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
>
http://www.mail-archive.com/flexcoders%40yahoogroups.com
> 
> 
> 
> 
> 
> SPONSORED LINKS 
> Web site design development
>
<http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+
>
site+design+development&w2=Computer+software+development&w3=Software+des
>
ign+and+development&w4=Macromedia+flex&w5=Software+development+best+prac
> tice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ>  
> Computer software
> development
>
<http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=We
>
b+site+design+development&w2=Computer+software+development&w3=Software+d
>
esign+and+development&w4=Macromedia+flex&w5=Software+development+best+pr
> actice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw>  
> Software design and
> development
>
<http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=
>
Web+site+design+development&w2=Computer+software+development&w3=Software
>
+design+and+development&w4=Macromedia+flex&w5=Software+development+best+
> practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ>       
> Macromedia flex
>
<http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+
>
development&w2=Computer+software+development&w3=Software+design+and+deve
>
lopment&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=1
> 66&.sig=OO6nPIrz7_EpZI36cYzBjw>       Software
> development best
> practice
>
<http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&;
>
w1=Web+site+design+development&w2=Computer+software+development&w3=Softw
>
are+design+and+development&w4=Macromedia+flex&w5=Software+development+be
> st+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw>  
> 
> 
> ________________________________
> 
> YAHOO! GROUPS LINKS 
> 
> 
>       
> *      Visit your group "flexcoders
> <http://groups.yahoo.com/group/flexcoders> " on the
> web.
>         
> *      To unsubscribe from this group, send an email to:
>        [EMAIL PROTECTED]
>
<mailto:[EMAIL PROTECTED]>
> 
>         
> *      Your use of Yahoo! Groups is subject to the
> Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/> . 
> 
> 
> ________________________________
> 
> 
> 



        

        
                
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs 
exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to