I am trying to update the dataProvider of a MenuBar without resetting
the menuBar dataprovider to the original array.

e.g.

private var menuData:Array = [];

private function init():void {
        menuData.push( { label: "test1", type: "normal" } );
        menuData.push( { label: "test2", type: "normal" } );
        menuData.push( { label: "test3", type: "normal" } );
}

<mx:MenuBar id="mb" dataProvider="{ menuData }" />

It works if I put everything in the initial property creation or if I do:

mb.dataProvider = menuData;

in the init function after I've done all of my array pushes, but I was
hoping there was a better way of doing things, i.e. firing an event or
calling a method.

I have tried mb.validateNow() (in fact, I've tried all validate
methods), but none seem to refresh the menuData dataProvider.

Anyone have any other ideas, or can tell me what I'm doing wrong?

Thanks.

Reply via email to