Input items to a ComboBox at runtime

Hi
I'm trying to use a comboBox to display a list of item only at runtime. For example, there are 2 combo boxes, the first one is a menu (1-4), when option 1 is selected at runtime, the second combo box should have a list for option 1 which might be (A-D). It this possible in LabView 8?

Please see attached for your reference.
In addition, you may consider using
Enum or
Menu Ring
to achieve your requirement
Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010
依恩与LabVIEW
LVVILIB.blogspot.com
Attachments:
IFK_GUI_Combo Box Cascade.vi ‏60 KB

Similar Messages

  • Create and fill combobox at runtime

    Hi,
    I can now create a combobox, as a child of a gridpanel, at runtime:
    HtmlSelectOneMenu combobox2 = new HtmlSelectOneMenu();
    combobox2.setId("dropdownProject");
    gridPanel1.getChildren().add(combobox2);
    Can someone help me out with how to set the items in the combobox, at runtime?
    From my previous OO-experience I thought I could create a model (DefaultSelectItemsArray?) and attach that to the viewer (the combobox) but I can't find any way of doing that.
    I must say that I'm a java beginner so that may be part of the problem ;-)
    Thanks already,
    Bart.

    Hi again,
    It took me 4 hours but I got it to work myself.
    For the archive, here's the code:
    ArrayList dropdown1Options = new ArrayList();
    dropdown1Options.add(new SelectItem("Choice 1","My First Project"));
    dropdown1Options.add(new SelectItem("Choice 2","My Second Project"));
    dropdown1Options.add(new SelectItem("Choice 3","My Third Project"));
    UISelectItems dropdown1SelectItems = new UISelectItems();
    dropdown1SelectItems.setValue(dropdown1Options);
    HtmlSelectOneMenu dropdown1 = new HtmlSelectOneMenu();
    dropdown1.setId("dropdownProject");
    dropdown1.getChildren().add(dropdown1SelectItems);
    gridPanel1.getChildren().add(dropdown1);
    The link I missed was the one between the HtmlSelectOneMenu and the UISelectItems.
    Appearantly you bind them using the getChildren().add() method. (?)
    I'm gonna give myself the duke dollars! :-)
    Cheers,
    Bart.

  • How to add an item  in the combobox list at runtime

    i want to add an item to the list of items in the combobox. How can I do this? I tried to use the methods getselecteditem() and getitem() from the actionlistener but no success.
    so after i add an item, the next time when i run that frame, that item should be displayed in the list of items in the combobox. Can anybody help me with this?

    Thanks Encephalophathic.
    Let me explain you the whole design -
    I have a frame having textfields and comboboxes. Now in the combobox, i have added some fields during design time and some i want the user to add at runtime. After the user clicks the Save button, i want the new string if entered in the combobox by the user at runtime to be added in the list of items of the combobox. So the next time when that frame is run, the item added by the user at runtime previously should be there in the list of items displayed in the combobox.
    What I am trying to do in this code at the combobox is if the user enters a new string in the combobox, then if he presses enter key, the value entered in the list of the combobox should be entered in the list of items of the combobox. Actually i m just trying to get the item typed in by the user, so just testing with enter key, but really i want it on the button click. I tried to add the code for adding an item to the combobox in the actionperformed, but i m not able to add it so confused what to do. Please help me with this.
    Here's the whole code for that -
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JCheckBoxMenuItem;
    import javax.swing.JComboBox;
    import java.awt.event.ActionListener;
    import javax.swing.JOptionPane;
    import javax.swing.JDialog.*;
    import javax.swing.JComboBox;
    public  class EnterFD implements ActionListener{
      private JFrame frame;
       private JPanel mainpanel,menupanel,userinputpanel,buttonpanel;
       private JMenuBar menubar;
       private JMenu menu,submenu;
       private JMenuItem menuitem;
       private JCheckBoxMenuItem cbmenuitem;
       private JLabel fdnumber;
       private JLabel bankname;
       private JLabel beneficiaryname;
       private JLabel entereddate;
       private JLabel maturitydate;
       private JLabel rateofinterest;
       private JLabel amount;
       private JLabel maturityamount;
       private JTextField fdnumbertxtfield;
       private JComboBox banknamecombobox;
       private JTextField beneficiarynametxtfield;
       private JComboBox entereddatecombobox;
       private JComboBox maturitydatecombobox;
       private JTextField rateofinteresttxtfield;
       private JTextField amounttxtfield;
       private JTextField maturityamounttxtfield;
       private JButton savebutton;
       private JButton clearbutton;
    public EnterFD() {
            initComponents();}
        private final void initComponents(){
            fdnumber = new JLabel("FD Number:");
            bankname = new JLabel("Bank Name:");
            beneficiaryname = new JLabel("Beneficiary Name:");
            entereddate = new JLabel("Entered Date:");
            maturitydate = new JLabel("Maturity Date:");
            rateofinterest = new JLabel("Rate Of Interest:");
            amount = new JLabel("Amount:");
            maturityamount = new JLabel("Maturity Amount:");
            fdnumbertxtfield = new JTextField();
            banknamecombobox = new JComboBox();
            banknamecombobox.addItem("State Bank Of India");
            banknamecombobox.addItem("Bank Of Baroda");
            banknamecombobox.addItem("IDBI Bank");
            banknamecombobox.addItem("ICICI Bank");
            banknamecombobox.addItem("Punjab National Bank");
            banknamecombobox.setEditable(true);
            banknamecombobox.setSelectedIndex(-1);
            banknamecombobox.addKeyListener(new java.awt.event.KeyAdapter() {
                @Override
                public void keyTyped(java.awt.event.KeyEvent evt) {
                    banknamecomboboxKeyTyped(evt);
            banknamecombobox.addKeyListener(new java.awt.event.KeyAdapter() {
                @Override
                public void keyReleased(java.awt.event.KeyEvent evt) {
                    banknamecomboboxKeyReleased(evt);
            beneficiarynametxtfield = new JTextField();
            entereddatecombobox = new JComboBox();
            maturitydatecombobox = new JComboBox();
            rateofinteresttxtfield = new JTextField();
            amounttxtfield = new JTextField();
            maturityamounttxtfield = new JTextField();
            menubar = new JMenuBar();
             menu = new JMenu("File");
             menubar.add(menu);
             menuitem = new JMenuItem("New");
             menu.add(menuitem);
             menuitem.addActionListener(this);
             menuitem = new JMenuItem("Save");
             menu.add(menuitem);
             menuitem.addActionListener(this);
             menuitem = new JMenuItem("Close");
             menu.add(menuitem);
             menuitem.addActionListener(this);
             menuitem = new JMenuItem("Exit");
             menu.add(menuitem);
             menuitem.addActionListener(this);
             menu = new JMenu("Edit");
             menubar.add(menu);
             menuitem = new JMenuItem("View FD");
             menu.add(menuitem);
             menuitem.addActionListener(this);
            mainpanel = new JPanel(new BorderLayout());
            menupanel = new JPanel(new BorderLayout());
            menupanel.add(menubar);
             userinputpanel = new JPanel(new GridLayout(8,2,5,20));
            userinputpanel.setBorder(BorderFactory.createEmptyBorder(50,50,80,80));
            userinputpanel.add(fdnumber);
            userinputpanel.add(fdnumbertxtfield);
            fdnumbertxtfield.setColumns(50);
            userinputpanel.add(bankname);
            userinputpanel.add(banknamecombobox);
            userinputpanel.add(beneficiaryname);
            userinputpanel.add(beneficiarynametxtfield);
            beneficiarynametxtfield.setColumns(50);
            userinputpanel.add(rateofinterest);
            userinputpanel.add(rateofinteresttxtfield);
            rateofinteresttxtfield.setColumns(50);
            userinputpanel.add(amount);
            userinputpanel.add(amounttxtfield);
            amounttxtfield.setColumns(50);
            userinputpanel.add(maturityamount);
            userinputpanel.add(maturityamounttxtfield);
            maturityamounttxtfield.setColumns(50);
            savebutton = new JButton("Save");
            clearbutton = new JButton("Clear");
            JPanel buttonpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
            buttonpanel.add(savebutton);
            buttonpanel.add(clearbutton);
            savebutton.addActionListener(this);
            clearbutton.addActionListener(this);
            mainpanel.add(menupanel,BorderLayout.NORTH);
            mainpanel.add(userinputpanel,BorderLayout.CENTER);
            mainpanel.add(buttonpanel,BorderLayout.SOUTH);
            frame = new JFrame("Enter FD");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(3000,3000);
            frame.setContentPane(mainpanel);
            frame.pack();
            frame.setVisible(true); }

  • Apex Page Input Item Label Conditional Style at run time

    Hi,
    Apex version 4.2.1.00.08
    We have an issue after migrating to apex 4.2.1. We have a select list and use another couple of dummy items to be used as its label instead of giving the text value to the LABEL control. Only one of the dummy items is shown as a label for the select list conditionally based on another value. It was working fine with the earlier versions upto 4.1, but with the introduction of grid in 4.2, its now displaying the select list on a new row (ie the lable in one row and the select list on the next row).
    However, we really would like to solve this by having a way to display the label of the select list either in "required format style" or as an "optional style". The display style should be determined only at runtime.
    Example. Say P100_MY_SELECT_LIST is the select list
    The label for this item is "My Select List Label"
    I have another dummy item P100_DUMMY
    if P100_dummy = 1 then the label "My Select List Label" should be displayed in red and with an * *My Select List LabelOtherwise it should be in black and without * My Select List LabelPlease help how to do this.
    Thanks in advance.
    Regards,
    Natarajan

    Well, I deviated with the various other things, and finally needed to get it fixed now. I find my own solution by having a Label Template which creates an ID for every label of the input item and calling a couple of javascript functions thro dynamic action.
    1) Create a label template "FormFieldDynamic" as follows
    In the template definition "Before Label"
    <img src="#IMAGE_PREFIX#requiredicon_status2.gif" alt="Required Field Icon" /><label for="#CURRENT_ITEM_NAME#" id="#CURRENT_ITEM_NAME#_LABEL" tabindex="999" class="itemLabel">in the "after label"
    </label>Note, I am having the image for the * always with the laebl and creating an ID for the label with id="#CURRENT_ITEM_NAME#_LABEL" .
    I have created a couple of javascript function to show the label dynamically as required or optional.
    function setLabelRqd(item) {
         var v = item+'_LABEL';
         var pid = document.getElementById(v);
         if (!((pid===null)||(pid===undefined))){
              pid.style.color = "red";
              $('#'+v).prev().show();
    function setLabelOpt(item) {
         var v = item+'_LABEL';
         var pid = document.getElementById(v);
         if (!((pid===null)||(pid===undefined))){
              pid.style.color = "black";
              $('#'+v).prev().hide();
    }Use the template if the input item (label) is dynamically set as Required or Optional at runtime based on a value of another item.
    How to:
    1.     Select the template FormFieldDynamic for the input item.
    2.    Create a dynamic action triggering on the change event of the page item which holds the conditional value to set the input item label as required or as optional.
    Under the When Section
    a.     Event => Change
    b.    Selection Type => Item(s)
    c.     Item(s) => PXXX_ITEM_NAME (The item that holds the conditional value to set the label for the input item
    d.    Condition => equal to
    e.     Value => Enter the value  for which the label needs to be displayed in Required format.
    f.     Set True Action
                                                              i.    Action => Execute Javascript Code  (Identification)
                                                             ii.    Fire on Page Load => checked (Execution Option)
                                                           iii.    Code => setLabelRqd(‘PXXX_ITEM_NAME’);  (Settings)  /*Call the javascript function to set the label as required*/
                                                            iv.    Selection Type => Item(s) (Affected Elements)
                                                             v.    Item(s) => PXXX_INPUT_ITEM1[,PXXX_INPUT_ITEM2]…
    g.     Set False Action
                                                              i.    Action => Execute Javascript Code  (Identification)
                                                             ii.    Fire on Page Load => checked (Execution Option)
                                                           iii.    Code => setLabelOpt(‘PXXX_ITEM_NAME’);  (Settings) /*Call the javascript function to set the label as optional*/
                                                            iv.    Selection Type => Item(s) (Affected Elements)
                                                             v.    Item(s) => PXXX_INPUT_ITEM1[,PXXX_INPUT_ITEM2]…It finally works for me :) and hope this will be helpful to others too. I will greatly appreciate anyone to mention it here if this helps for him.
    Thanks,
    Natarajan

  • ActionPerformed to get the selectiom of an item in a comboBox.

    hi,
    to select an item in a comboBox, actionPerformed works fine
    if the item is selected the first.
    comboBox.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                    // do something
    but
    actionPerformed don't works to select an item in a combobox with only one item
    and
    it don't work if the user select the same item more than one time...
    I would ask: what is the best way to get always, and in every case, the selection of an
    item in a combobox ?
    thank in advance for any suggestion
    regards
    tonyMrsangelo

    thank you Joerg for answering me,
    I understand your code, but your solution is not what I am looking for.., because you use a button to
    select items, and I don't will it.
    My problem has a this scenario:
    a JTable show informations, and a column in the JTable contain comboBoxs.
    The items of bomboBoxes are sintetics information, and, clicking an item of the comboBoxes, a window
    is loaded to show them better..
    To not complicate the project of the GUI, I prefer don't use buttons, the user have to be able to load the window only clicking
    the items of the comboboxes...
    Actually I spent some time to look for a solution, and I found something similar what you proposed:
    *I used two listener to manage the action to click the items of comboboxes..
    - ActionListener when they are many items in the comboBox
    - MouseListener when it is only one item in the comboBox*
                comboBox.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                        if(comboBox.getItemCount()> 1){
                            showDedailsOfSelectedTreatment(comboBox);
                comboBox.addMouseListener(new MouseAdapter() {
                    public void mouseClicked(MouseEvent e) {
                        if(comboBox.getItemCount()==1){
                            showDedailsOfSelectedTreatment(comboBox);
                });Reading your proposal I think that I did the best possible...
    as well I think the framework to manage listener for comboBoxes could be better..
    please let me know what you think about..
    thank you
    regards
    tonyMrsangelo

  • How to avoid validation of input items within af table and javascript

    Hi all,
    I developed a form which includes table and commandButton. Some input items are required. I want them to validate while just button pressed.
    And everything was ok, this scenario was working well. But when table presents only one row, selecting row does not work. See alsa plz: Table row selection --> might be 9th post
    I applied to my jsff the solution which is told in above link. It works previous issue but this time, javascript caused another problem that is inconsistent validation. As i understood java script overrides af table immediate="true" property. plz see : http://www4.picturepush.com/photo/a/11897217/640/11897217.png
    How can i resolve that? Any suggestion?
    Plz help me
    Thanks in advance
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:trh="http://myfaces.apache.org/trinidad/html"
    xmlns:f="http://java.sun.com/jsf/core">
    <trh:script>
    function tableLoad(event)
    AdfCustomEvent.queue(event.getSource(), "refreshTables",
    true);
    event.cancel();
    </trh:script>
    <af:table var="row" rowBandingInterval="1" id="entityT"
    value="#{pageFlowScope.incomingPaperworkBean.baseRowCollection}"
    partialTriggers="::cb_incPaperDef_commit ::cb_incPaperDef_filter"
    rowSelection="single" columnBandingInterval="0"
    disableColumnReordering="true" columnStretching="column:c3"
    styleClass="AFStretchWidth" autoHeightRows="20"
    contentDelivery="immediate" immediate="true"
    binding="#{pageFlowScope.incomingPaperworkBean.richTable}">
    <af:clientListener method="tableLoad" type="click"/>
    <af:serverListener type="refreshTables"
    method="#{pageFlowScope.incomingPaperworkBean.refreshTables}"/>
    <af:column id="c5" width="105">
    <af:inputText id="registrationText"
    value="#{row.baseEntity.registrationNumber.registrationNumber}"
    required="true" readOnly="true" autoSubmit="true"
    disabled="true"/>
    <f:facet name="header">
    <af:panelGroupLayout id="panelGroupLayout1" layout="vertical">
    <af:inputText id="filterRegistrationNumber"
    value="#{pageFlowScope.incomingPaperworkBean.filterTemplate.incomingPaperwork.registrationNumber.registrationNumber}"
    simple="true" autoSubmit="true"/>
    <af:spacer width="10" height="10" id="spacer1"/>
    <af:outputText value="Kayit Numarasi" id="outputText6"/>
    </af:panelGroupLayout>
    </f:facet>
    </af:column>
    Edited by: webyildirim on 07.Oca.2013 06:08

    I guess you want the table header skin selector listing. [http://download.oracle.com/docs/cd/E15523_01/apirefs.1111/e15862/toc.htm|http://download.oracle.com/docs/cd/E15523_01/apirefs.1111/e15862/toc.htm]
    search on af:table
    I only see one mention of a table header though, so maybe this is the problem.
    Have you looked at the html that is output (with Firebug) perhaps and seen what sort of style classes are associated with your table component? in 11g it seems that there are more human-readable style classes that you can guess at by looking at the html source.
    Good luck

  • Search an item in a combobox

    Ok, this is perhaps an easy one, but I was just wondering.
    How can one find the correct item in a combobox. So I have a combobox filled with (unordered) String items (not much, just 20 or so) and I want to select the string I have in a config file. Now I'm using code like :
    int selRow= 0; boolean found = false;
    while(selRow<cbo.getItemCount() && !found){
        found = (search_string().equals((String)cbo.getItemAt(selRow)))
        selRow++;
    }and --selRow is the selected item if its in the combobox. By having only 20 items, speed shouldn't matter, but I was just wondering if this is the cleanest way of doing things like this.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    >
    To refine could also have been:
    int selRow= 0; boolean found = false;
    while(selRow++<cbo.getItemCount() && !found){
    found =(search_string().equals((String)cbo.getItemAt(selRow)))
    But the question remains - why?
    Using a combobox like this hints of design issues.....
    that's not the same, if u want to correct it you should do it like this
    int selRow= 0; boolean found = false;
    while(selRow<cbo.getItemCount() && !found){
    found =(search_string().equals((String)cbo.getItemAt(selRow++)))
    }but that was not the point, I was looking for other ways of doing the same

  • Programmatically clearing an input item does not work

    Hello,
    I want to clear one input item (RichInputListOfValues) contained in a PanelForm programmatically, after the user presses on the "Clear" button:
    <af:commandToolbarButton text="Clear" id="ctb1"
    actionListener="#{pageFlowScope.UiBindings.clearItem}"/>Where the code that should really clear the item is:
        public void clearItem(ActionEvent actionEvent) {
                getItem().setValue(null);
                // getItem().resetValue(); // even with this, it does not work.
                AdfFacesContext.getCurrentInstance().addPartialTarget(getItem());
        public RichInputListOfValues getItem() {
            return item;
        }However, the above does not clear the item on the page. I have to click a second time to actually see the item empty as expected.
    The problem still appears if I also do addPartialTarget() on the PanelForm container.
    Do you have any idea?

    My test case:
    JDeveloper 11.1.2.2
    page:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
        <af:document title="untitled1.jsf" id="d1">
            <af:form id="f1">
                <af:toolbar id="t1">
                    <af:commandToolbarButton text="Clear" id="ctb1" actionListener="#{viewScope.myBean.clear}"/>
                </af:toolbar>
                <af:inputListOfValues label="Label 1" popupTitle="Search and Result Dialog" id="ilov1"
                                      binding="#{viewScope.myBean.item}"/>
            </af:form>
        </af:document>
    </f:view>bean:
    package view;
    import javax.faces.event.ActionEvent;
    import oracle.adf.view.rich.component.rich.input.RichInputListOfValues;
    import oracle.adf.view.rich.context.AdfFacesContext;
    public class myBean
      private RichInputListOfValues item;
      public myBean()
      public void setItem(RichInputListOfValues item)
        this.item = item;
      public RichInputListOfValues getItem()
        return item;
      public void clear(ActionEvent actionEvent)
        getItem().setValue(null);
        AdfFacesContext.getCurrentInstance().addPartialTarget(getItem());
    }config:
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <managed-bean id="__1">
        <managed-bean-name>myBean</managed-bean-name>
        <managed-bean-class>view.myBean</managed-bean-class>
        <managed-bean-scope>view</managed-bean-scope>
      </managed-bean>
    </adfc-config>It works fine on the first click. Something's not right on your end :)
    John

  • Ho to calculate the number of items in a ComboBox ?

    Ho to calculate the number of items in a ComboBox ?

    I found a good solution
    I developped this method by myself and it my help all people
    public function findComboIndex(criteria:String,
    combo:ComboBox): void
    combo.selectedIndex = 0;
    var tempCriteria:String ='';
    while (combo.selectedLabel != '')
    if (combo.selectedLabel == criteria)
    break;
    if (combo.selectedLabel == chaineTemp)
    combo.selectedIndex = -1;
    break;
    tempCriteria= combo.selectedLabel;
    combo.selectedIndex++;
    good luck

  • Backflushing variable input item.

    Hello,
    During back flushing GI and GR of component will be done automatically as per quantities mentioned in bom.
    But if we have variable input item, whose quantities differ from quantities mentioned in the bom then how can you performed back flusing for the material.
    Ex:- mate X is req 1ltr to make 10 ltr of finished mat A;
    If in case only .9 ltr of X is consumed to produce mat A , how can we perform backflushing for X

    Hi,
    during Backflushing in the component screen maintain manually as 9 Ltrs
    so system will consume only 9 Ltrs
    Regards
    kumar

  • Custom Font On Individual Row Items In A ComboBox Component

    Hello everyone,
    I am new to flash and I have spent many hours trying to get a
    particular piece of functionality to work. I am trying to create a
    combobox where the items listed in the combobox are font names and
    each item will display using the font of the item label. For
    instance, one item label in the list is "New Times Roman" and I
    want that particular row in the combobox to have the text AND font
    of "New Times Roman". For some reason, inside of my custom
    CellRenderer class, I cannot seem to find a way to get the item
    label that corresponds to the CellRenderer and the
    CellRenderer.data item always appears to be null!
    Please help. Thank you in advance for any help you can
    provide.
    This is the code I am currently using:
    //From the main class, I am creating an instance of the
    CustomizableComboBox and adding in the font names I am interested
    in.
    var comboFont:CustomizableComboBox=new
    CustomizableComboBox();
    comboFont.width=200;
    comboFont.height=30;
    comboFont.addItem({label:"Arial", data:"Arial"});
    comboFont.addItem({label:"Times New Roman", data:"Times New
    Roman"});
    comboFont.addItem({label:"Tahoma", data:"Tahoma"});
    comboFont.addItem({label:"Verda", data:"Verda"});
    comboFont.addItem({label:"Wide Latin", data:"Wide Latin"});
    comboFont.addItem({label:"Monotype Corsiva", data:"Monotype
    Corsiva"});
    comboFont.addItem({label:"Trebuchet MS", data:"Trebuchet
    MS"});
    comboFont.addItem({label:"Alba", data:"Alba"});
    comboFont.addItem({label:"Arial Black", data:"Arial Black"});
    comboFont.selectedIndex=1;//Times New Roman by default.
    addChild(comboFont);
    //In the CustomComboBox.as file, I have the CustomComboBox
    class defined as:
    package {
    import fl.controls.ComboBox;
    import flash.text.TextFormat;
    import flash.events.Event;
    public class CustomizableComboBox extends ComboBox{
    public function CustomizableComboBox(){
    super();
    dropdown.setStyle("cellRenderer",CustomCellRenderer);
    addEventListener(Event.CHANGE,changeIndex);
    //Changes the text displayed as the currently selected item
    with its corresponding font.
    private function changeIndex(event:Event):void {
    var fontName:String=selectedItem.label;
    var format:TextFormat=new TextFormat(fontName,16);
    setStyle("textFormat",format);
    //Finally, in the CustomCellRederer.as file, I have defined
    the CustomCellRenderer class as:
    package{
    import fl.controls.listClasses.CellRenderer;
    import flash.text.TextFormat;
    import fl.controls.ComboBox;
    public class CustomCellRenderer extends CellRenderer{
    public function CustomCellRenderer(){
    //The trace will show that the data for the custom
    cellrenderer is always null!!!
    trace('custom cell data = '+data);
    //If I could just get the item label corresponding to the
    CellRenderer for this
    //cell, then I could set the font as I desire.
    var fontName:String="Wide Latin";
    var format:TextFormat = new TextFormat(fontName,16);
    setStyle("textFormat", format);
    }

    Oh, sorry. I see now what you want to do. Hmmm...
    I cannot find any references to the class that defines each
    item in the box. Off the top of my head what I would do (besides
    writing my own combobox :-) - I would add some event listener with
    capture set to true that would listen to the input text field
    change Event.CHANGE and set ComboBox.editable = true. So, when you
    type something in the item - it will dispatch event. By reading
    Event.target, you may figure out what object is the TextField you
    want to chage the style for. After that it may be possible just to
    change style for each individual item's TextField.
    myComboBox.editable = true;
    myComboBox.addEventListener(Event.CHANGE, changeHandler);
    private function changeHandler(e:Event):void{
    trace(e.target + " : " + e.currentTarget);
    Just a thought...

  • How to show all items in a ComboBox when open

    Hi there,
    I have a combobox, with about 8 items from an array. I am trying to have it open and show all the items to the user without scrolling. Anyone know how to do this?
    Thanks!

    I'm pretty sure that if you specify the rowCount to 8 it should do it:
    http://www.adobe.com/livedocs/flex/3/langref/mx/controls/ComboBox.html#rowCount

  • How to select an item in s:ComboBox

    With the mx:ComboBox setting a selected item from a data source was easy:
    <mx:ComboBox dataProvider="{siteDictionary}" value="{getService.lastResult.@idSite}"/>
    Where the dictionary is defined as something like this:
    [Bindable] public var siteDictionary:ArrayCollection = new ArrayCollection([
       {label:"Site 1", data:'1'},
       {label:"Site 2", data:'2'}]);
    And getService returns something like:
    <service idSite="2"/>
    With spark, I tried this:
    <s:ComboBox dataProvider="{siteDictionary}" selectedItem="{getService.lastResult.@idSite}"/>
    But obviously it doesn't work, because I just have the id, not the entire object.  This is such a basic task I'm amazed that I could not find any examples on how to do it.  I did find one, where a person set the selectedIndex just by looping through the dataProvider until they found the id.  I REFUSE to accept that is the only way to do this!  Seems like a step backward to me.  Anyone know the right way?

    Sorry, didn't notice you were using the value property on mx:ComboBox.
    If you're getting back XML, unless you are going to access the data often,
    you might be better off leaving it as XML and using XMLListCollection
    instead of ArrayCollection.
    Then, since you can probably guarantee that the XML query will return one
    and only one XML node try:
    selectedItem="{XML(getService.lastResult).@idSite[0]}"
    If you really have to work with XML converted to objects you'll have to loop
    through and find it.  That's what mx:ComboBox did under the covers anyway.

  • Setting CSS Class for a Text Input Item when the disable property set to true

    Hi,
    i have OAF page and the item style is Message text input and i have set the disable property is TRUE using SPELL.
    i want to display the value is BOLD for the item. so i set the CSS class for the item to  OraTipLabel,OraDataText etc using item property or in process request also. the value is not setting BOLD.
    the field is gery out and frozen and it is not displaying BOLD.
    Please advise for the same.
    Thanks
    Sreekanth

    Hi Avaneesh,
    It is still not working for me.
    Still waiting for some pointers
    Anas.

  • Setting Combobox 'dataProvider' @runtime and using 'labelFunction'

    I have 2 comboboxes which are related i.e. when i change cb-1 i need to display values in cb-2 (cb-2 list varies with the value selected). I have simplified my case but this is what my problem is. After i set 'cb-2.dataProvider' when does 'labelFunction' for cb-2 get called?
    If i am not clear enough please let me know. Here is the code.....
    private function cb-1Change(event:ListEvent):void
    {// This will be a dynamic one using the value selected in cb-1
    cb-2.dataProvider = __model.someList.getItemAt(0).cb-2VOList;  // extracting from a Map kind object
    // This Label function is never getting called
    private function displayCB-2Label(item:Object):String{ 
         // something
    <mx:ComboBox d="cb-1"           dataProvider="{__model.cb-1List}"
              change="cb-1Change(event)"
    />
    <mx:ComboBox d="cb-2"
              labelFunction="displayCB-2Label(event)"
              change="cb-1Change(event)"
    />
              change="cb-1Change(event)"
    />  

    Ryan,
            Thanks for the answer. I think i was not clear on my questions. Let me try it again:
    Requirement:
           When ever user change cb-1 value it should populate a new list and assign to cb-2 dataProvider i.e. cb-2 list should refresh. cb-2 needs to display right label based on its 'labelFunction'.
    cb1 -  List of Strings
    cb2 -  List of VO's in the following format
    ListVO:
           public var code:String;    // This Code is what user selects in cb-1
           public var  listValues:ArrayCollection;  // List of PlainVO's
    PlainVO:
         public var name:String;
         public var value:String;
    Also from your answer how can i call 'cb-2 label function in cb-1 change', i mean cb-2 labelFunction expects current 'ListVO' object...right?

Maybe you are looking for

  • Import GMail Contacts? How to?

    I'm a new Mac user and would like to sync my many GMail  contacts with Apple Mail. The aim is to be able to start typoing a contact in Apple Mail and autofill the rest of the e-mail address that I have had in Gmail. Right now that isn't happening. I

  • Burst Reports-DESKI-BOXI R2 SP2

    Hello All, We have some DESKI reports those are scheduled to run on every Tuesday. Today these reports are failed for couple of users with the following reason:- Status: Failed Destination: None Start Time: 12 May 2009 12:08:26 o'clock BST End Time:

  • Nokia SDK with browser embedded Flashlite available?

    Hi, does anybody know if there is an NOKIA (or other) SDK available which is able to display flashlite content *within* the browser? I've tried several (but not all) SDKs (Series 40 SDK 3rd Edition FP2, Series 60 SDK 3rd Edition FP 2 beta, Series 40

  • G4MX440-VT8X128 WDM capture problem

     ;( I've got a problem using the G4MX440-VT8X128 http://www.msicomputer.com/product/vga/v...4MX440-VT8X128. On device manager, everything is OK, nothing red neither yellow. When I try to capture, it captures only a blank movie / picture. Any hint to

  • My IMAP inbox message vanish/disappear until I quit mail & open it again

    Hi All, Hoping that someone can give me a few pointers about a small and rather annoying issue i've found with OS X 10.6.1 Mail. I'm using IMAP to connect to my hosted GMail account, however from time to time all my inbox comes up blank with no messa