http://blog.comtaste.com/2007/07/conditional_visualization_in_c_1.html
package ...
{
...
public class MyViewHelper extends ViewHelper
{
private var myChangeWatcher:ChangeWatcher;
public function MyViewHelper() {
myChangeWatcher = ChangeWatcher.watch(MyModelLocator.getInstance(), “myDataSource”, prepareDataProvider);
}
private function prepareDataProvider(event:Event) {
var myAC:ArrayCollection = new ArrayCollection();
for each(var item:Object in MyModelLocator.getInstance().myDataSource) {
//if item satisfies certain conditions
myAC.addItem(item);
}
view.myDataProvider = myAC;
}
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment