RE: [flexcoders] Cairngorm2 and views

2006-02-08 Thread Alex Uhlmann





Hi Dominick,

you are right, we could have used view states. But we 
decided to use a ViewStack because our intend was that the login component 
switches to a very different "application" component after logging in. Basically 
when usingview statesin hereyou wouldhave to remove and 
then add completly different components.For us this was the exact 
definition of a ViewStack. I would think of using states in view components that 
change it's state based on a base state.

However, this is how it would look like using states. The 
conceptof changing a state in your model, and other views bind to that 
state property stays the same.

mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml"xmlns:business="org.nevis.cairngorm.samples.login.business.*" 
xmlns:control="org.nevis.cairngorm.samples.login.control.*" 
xmlns:view="org.nevis.cairngorm.samples.login.view.*"pageTitle="Cairngorm 
Login Sample Application"marginTop="5" marginBottom="5" 
marginLeft="5" marginRight="5" 
horizontalAlign="center"currentState="{ getState( 
model.workflowState ) }" 
mx:statesmx:State 
name="loggedIn"mx:AddChild 
position="lastChild"mx:Label text="{'Logged 
in ' + model.loginDate}" 
id="label1"//mx:AddChildmx:AddChild 
position="lastChild"mx:Button 
label="Back"mx:clickmodel.workflowState 
= 
ModelLocator.VIEWING_LOGIN_SCREEN;/mx:click/mx:Button/mx:AddChildmx:RemoveChild 
child="{login}"//mx:State/mx:statesmx:Script![CDATA[import 
mx.core.UIComponent;import 
org.nevis.cairngorm.samples.login.model.ModelLocator;//-

public function getState( newState : Number ) : 
String{if( newState == 
ModelLocator.VIEWING_LOGGED_IN_SCREEN 
){return 
"loggedIn";}else{return 
"";}}

[Bindable]public var model : 
ModelLocator = 
ModelLocator.getInstance();]]/mx:Script

!-- 
== 
--!-- the ServiceLocator where we specify the remote 
services --business:Services id="loginServices" 
/!-- the FrontController, containing Commands 
specific to this appliation --control:DemoControl 
id="controller" /!-- 
== 
--

 view:Login 
id="login" /

/mx:Application

Best,
Alex




  
  

  


  
  

Alex UhlmannTechnical Consultant (Rich 
Internet Applications)Adobe ConsultingWestpoint, 4 Redheughs 
Rigg, South Gyle, Edinburgh, EH12 9DQ, UKp: +44 (0) 131 338 
6969
m: +44 (0)7917 428 951[EMAIL PROTECTED] 
  



From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of Dominick 
AccattatoSent: 08 February 2006 14:08To: 
flexcoders@yahoogroups.comSubject: [flexcoders] Cairngorm2 and 
views

Steven and crew:

Thanks for getting us an alpha build to work with. Flex 2 is my first 
opportunity to really start working with the flex framework. As a side 
note, I had worked with aspatterns for a number of projects so I'm familiar with 
the micro-architecture. My question is simple. The login example 
uses viewstacks to change views. This works fine. However, to take 
advantage of view states and transistions, shouldn't we just change states now 
instead of using viewstacks? Thanks very much for all the hard work. 
I look forward to the answer. 

Dominick Accattato, CTO
www.newviewnetworks.com






--
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.



  









Re: [flexcoders] Cairngorm2 and views

2006-02-08 Thread Dominick Accattato



Thanks Alex. Yes I see your point. Beauty is in the eye of the beholder. 
I'd go login screen  eula agreement  register  main application...
All of those would be states. and I'd transistion between them. This much would be reusable for other apps.. Once I get to the main application I would then load whatever I need. 

Aggain thanks for clarifying the reasoning behind the login example.
On 2/8/06, Alex Uhlmann [EMAIL PROTECTED] wrote:

Hi Dominick,

you are right, we could have used view states. But we decided to use a ViewStack because our intend was that the login component switches to a very different application component after logging in. Basically when usingview statesin hereyou wouldhave to remove and then add completly different components.For us this was the exact definition of a ViewStack. I would think of using states in view components that change it's state based on a base state.


However, this is how it would look like using states. The conceptof changing a state in your model, and other views bind to that state property stays the same.


mx:Application xmlns:mx=
http://www.macromedia.com/2005/mxmlxmlns:business=org.nevis.cairngorm.samples.login.business.* xmlns:control=org.nevis.cairngorm.samples.login.control.* xmlns:view=org.nevis.cairngorm.samples.login.view.*
pageTitle=Cairngorm Login Sample ApplicationmarginTop=5 marginBottom=5 marginLeft=5 marginRight=5 horizontalAlign=center
currentState={ getState( model.workflowState ) } mx:statesmx:State name=loggedInmx:AddChild position=lastChildmx:Label text={'Logged in ' + 
model.loginDate} id=label1//mx:AddChildmx:AddChild position=lastChildmx:Button label=Backmx:clickmodel.workflowState
 = ModelLocator.VIEWING_LOGIN_SCREEN;/mx:click/mx:Button/mx:AddChildmx:RemoveChild child={login}//mx:State/mx:statesmx:Script
![CDATA[import mx.core.UIComponent;import org.nevis.cairngorm.samples.login.model.ModelLocator;//-


public function getState( newState : Number ) : String{if( newState == ModelLocator.VIEWING_LOGGED_IN_SCREEN ){return loggedIn;
}else{return ;}}

[Bindable]public var model : ModelLocator = ModelLocator.getInstance();]]/mx:Script

!-- == --!-- the ServiceLocator where we specify the remote services --
business:Services id=loginServices /!-- the FrontController, containing Commands specific to this appliation --control:DemoControl id=controller /
!-- == --

 view:Login id=login /

/mx:Application

Best,
Alex













Alex UhlmannTechnical Consultant (Rich Internet Applications)Adobe ConsultingWestpoint, 4 Redheughs Rigg, South Gyle, Edinburgh, EH12 9DQ, UKp: +44 (0) 131 338 6969
m: +44 (0)7917 428 951[EMAIL PROTECTED] 




From: flexcoders@yahoogroups.com [mailto:
flexcoders@yahoogroups.com] On Behalf Of Dominick AccattatoSent: 08 February 2006 14:08To: 
flexcoders@yahoogroups.comSubject: [flexcoders] Cairngorm2 and views


Steven and crew:

Thanks for getting us an alpha build to work with. Flex 2 is my first opportunity to really start working with the flex framework. As a side note, I had worked with aspatterns for a number of projects so I'm familiar with the micro-architecture. My question is simple. The login example uses viewstacks to change views. This works fine. However, to take advantage of view states and transistions, shouldn't we just change states now instead of using viewstacks? Thanks very much for all the hard work. I look forward to the answer. 


Dominick Accattato, CTO
www.newviewnetworks.com
--Flexcoders Mailing ListFAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txtSearch 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. 










--
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 

RE: [flexcoders] Cairngorm2 and views

2006-02-08 Thread Steven Webster





Dominick,

So Cairngorm is never intending to be prescriptive about 
how you architect your view - I'll have some articles available shortly that 
discuss this in more detail. But your question is a valid one - 
where do we use states and transitions in our view. Some of our own team 
have been thinking about this in detail in the last few weeks, but we've nothing 
concrete to share at this stage.

I'd be as interested in your thoughts as you're interested 
in mine !

Best,

Steven



  
  

  


  
  

Steven WebsterPractice Director (Rich 
Internet Applications)Adobe ConsultingWestpoint, 4 Redheughs 
Rigg, South Gyle, Edinburgh, EH12 9DQ, UKp: +44 (0) 131 338 
6108
m: +44 (0)7917 428 947[EMAIL PROTECTED] 
  


  
  
  From: flexcoders@yahoogroups.com 
  [mailto:[EMAIL PROTECTED] On Behalf Of Dominick 
  AccattatoSent: 08 February 2006 06:08To: 
  flexcoders@yahoogroups.comSubject: [flexcoders] Cairngorm2 and 
  views
  
  Steven and crew:
  
  Thanks for getting us an alpha build to work with. Flex 2 is my 
  first opportunity to really start working with the flex framework. As a 
  side note, I had worked with aspatterns for a number of projects so I'm 
  familiar with the micro-architecture. My question is simple. The 
  login example uses viewstacks to change views. This works fine. 
  However, to take advantage of view states and transistions, shouldn't we just 
  change states now instead of using viewstacks? Thanks very much for all 
  the hard work. I look forward to the answer. 
  
  Dominick Accattato, CTO
  www.newviewnetworks.com
  





--
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.