[Bindable] ArrayCollection


here code, problem set modules fires once, , not fire when collection changes, additem() used on collection.

class containing array collection
[bindable]
public class app
{
public function modules():arraycollection { return this._modules; }
private var _ modules: arraycollection = new arraycollection ();

public static function instance():app
{
if(!app._instance) app._instance = new app ();
return app._instance;
}
private static var _instance: app;
}

here binding mxml
modules=”{app.instance.modules}”

here set modules above , there no get.
public function set modules(modules : arraycollection):void
{
alert.show("modules="+modules.length);
}

modules called once , never called again when collection changes, verified creating click event manually updates modules, debugging

here code test click event:
public function onclick():void
{
this.modules = webapplication.instance.webcmsmodules;
}


also works if use var instead of set problem need fire code when modules set cant used.
public var modules:arraycollection;





More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support