5/28/2010 7:22:24 PM
Title:
CheckBox Item Renderer
Hi,
I have a popupbutton, popupButton inside checkbox itemrenderer. I get the data from the database, So i want to select the check boxes one, more and All, How to do it?
Please help me?
Thanks
5/28/2010 9:16:53 PM
check this example in actionscript 3.0 and flex to populate a popupbutton in flex with xml as data provider. You can add any control like checkbox to popupButton. See this source code. The data coming from your database should be in same format as its in the xml :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:XML id="xmlDataprovider">
<root>
<node label="type=check" id="ch" type="check" toggled="true" />
<node label="type=check" id="ch1" type="check" toggled="true" />
<node label="type=check" id="ch2" type="check" toggled="true" />
<node label="type=check" id="ch3" type="check" toggled="true" />
</root>
</mx:XML>
<mx:Script>
<![CDATA[
import mx.controls.Menu;
private var menu:Menu;
private function init():void {
menu = new Menu();
menu.labelField = "@label";
menu.dataProvider = xmlDataprovider;
menu.showRoot = false;
menu.width = popUpButton.width;
popUpButton.popUp = menu;
}
]]>
</mx:Script>
<mx:PopUpButton id="popUpButton" label="Select Item" width="200" creationComplete="init();" />
</mx:Application>
5/29/2010 4:48:56 AM
you cannot select multiple checkbox at a time in the popup button. Because it closes as soon as you click on a single checkbox. you need to again click to open and select another checkbox.