RE: [flexcoders] Saving modelLocator variable in sharedObject?

2006-01-24 Thread Barrau Antoine
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 : 
> 
>  
> 
>  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
>

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
>

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
>

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
>


RE: [flexcoders] Saving modelLocator variable in sharedObject?

2006-01-23 Thread Dimitrios Gianninas





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 
antonin34Sent: Monday, January 23, 2006 9:32 AMTo: 
flexcoders@yahoogroups.comSubject: [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 : 
 
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
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



   Visit your group "flexcoders" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.