Hi Tracy,
I'm not sure if this will make any difference, but the entire Cairngorm
ModelLocator class is Bindable instead of the individual variables.
Perhaps this would make a difference with your model.
-TH
[Bindable]
public class ModelLocator implements
com.adobe.cairngorm.model.ModelLocator
{
private static var modelLocator:com.ets.main.model.ModelLocator;
public static function getInstance() : com.ets.main.model.ModelLocator
{
if ( modelLocator == null )
modelLocator = new com.ets.main.model.ModelLocator();
return modelLocator;
}
//----------------------------------------------------------------------\
---
public function ModelLocator()
{
if ( com.ets.main.model.ModelLocator.modelLocator != null )
throw new Error( "Only one ModelLocator instance should be
instantiated" );
}
}
--- In [email protected], "polestar11" <[EMAIL PROTECTED]> wrote:
>
> Hi there
>
> I have a class containing 2 variables, which I am trying to bind to a
> seperate component. I am not using Cairngorm, although the structure
> is quite similar, in that I have a component (view) that references
> values in a singleton class (model)
>
> In the model-like class I have the following:
>
> public function addItem(item:MyClassObject) {
> currentItem = item;
> currentItems.addItem(item);
> }
>
> [Bindable]
> public var currentItem:MyClassObject;
> [Bindable]
> public var currentItems:ArrayCollection;
>
> In the view-like class I reference the variables like so:
>
> <ns1:MultiView id="multiView"
dataProvider="{itemManager.currentItems}" />
> <mx:Label id="tmpLabel" text="{itemManager.currentItem.title}" />
>
> In the script part of this component I reference the model-like class:
> [Bindable]
> public var itemManager:ItemManager = ItemManager.getInstance();
>
> My MultiView class is a custom component that takes the
> ArrayCollection of 'currentItems' and adds them as children. There
> might be a problem in this code preventing the associated children
> from updating.
>
> The binding should however work for the label (tmpLabel).
>
> Any help much appreciated
>
> Tracy
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Something is new at Yahoo! Groups. Check out the enhanced email design.
http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->
--
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/