Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts

    Question Design - add to combo box

    How do I add options to a combo box? The first one I'm working with will be a Yes/No. Radio button or check boxes are not an option in this case.
    .
    .
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls

  • #2
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts
    As no one seem to know how to do this, and I just found out how, I'll post the solution. There are two, but I don't know the other one yet.

    Code:
    <mx:FormItem id="householdExceptionsLabel"
    	label="Household Exceptions"
    	top="35" right="5"
    	horizontalAlign="right">
    	<mx:ComboBox
    		id="householdExceptionsData"
    		width="75">
    		<mx:dataProvider>
    			<mx:ArrayCollection>
    				<mx:String>Yes</mx:String>
    				<mx:String>No</mx:String>
    			</mx:ArrayCollection>
    		</mx:dataProvider>
    	</mx:ComboBox>
    </mx:FormItem>
    .
    .
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls

  • #3
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts
    Found the second way. This involves using a script.

    This is the control:
    Code:
    <mx:FormItem id="householdExceptionsLabel"
    	label="Household Exceptions"
    	top="32" right="5"
    	horizontalAlign="right">
    	<mx:ComboBox id="householdExceptionsData"
    		width="75"
    		dataProvider="{englishYesNo}" />
    </mx:FormItem>
    This is the script:
    Code:
    <mx:Script>
    	<![CDATA[
    		import mx.collections.ArrayCollection;
    		import mx.controls.Alert;
    
    		[Bindable]
    		private var englishYesNo:ArrayCollection = 
    			new ArrayCollection([
    			"Yes",
    			"No"]);
    ...
    		for (i=0;i<1;i++)
    		{
    			householdExceptionsData.dataProvider[i] = englishYesNo[i];
    			householdTANFData.dataProvider[i] = englishYesNo[i];
    		}
    There is a language test that uses either the spanishYesNo (not shown) or the englishYesNo variable.

    Hope this is helpful to anyone else.
    .
    .
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •