[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;
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
Post a Comment