Hi Kent, we decided to make 5 components of Cairngormstore more modular and abstracted the ModelLocator. The ShoppingCart.mxml component was one of those components. If you look into Main.mxml you'll see the inisialisation of ShoppingCart.mxml
<cart:ShoppingCart id="shoppingCartComp" width="100%" height="100%"
shoppingCart="{ModelLocator.shoppingCart}"
selectedItem="{ModelLocator.selectedItem}"
select="ModelLocator.selectedItem = event.target.selectedItem"
currencyFormatter="{ModelLocator.currencyFormatter}" />
ShoppingCart.mxml accepts a shoppingCart instance of type
org.nevis.cairngorm.samples.store.business.ShoppingCart. In our case
this comes from ModelLocator. The dataProvider property of the DataGrid
in ShoppingCart.mxml is bound to the elements property of
org.nevis.cairngorm.samples.store.business.ShoppingCart. This
ShoppingCart class is also in the as2docs. Basically, the elements
property is a collection of ShoppingCartElement objects that represent
one element. The ShoppingCart class itself represents all elements and
some additional connected information concerning all elements like the
totalProductPrice or shippingCost.
hope that helps,
Alex
--
Alex Uhlmann
Software Engineer
iteration::two
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
Behalf Of Kent Henneuse
Sent: 20 June 2005 16:35
To: [email protected]
Subject: [flexcoders] Cairngorm Store missing link?
Ok it is a missing link in my brain and not a link that is missing.
I am confused how the dataProvider on line 58 of ShoppingCart.mxml gets
linked to the one in the ModelLocator? It appears as if everything is
done
by manipulating the ShoppingCart object that is in the ModelLocator and
some
how it is getting changed in the View.
I ask because I currently have an Array of objects that represent lines
in a
DataGrid. When I add an element to that array I am not seeing it in the
datagrid. I figure that it has something to do with the redrawing of
the
component. I looked at the Cairngorm Store as an example because it is
very
similar to what I am trying.
Anxiously awaiting the next Blog installments on the Cairngorm store,
-Kent
"Black holes are where God divided by zero."
- Steven Wright
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/
<<winmail.dat>>

