Setting Data Field of Combo Box

I have a result set passed back as an Array. I want to set
and reference a combo box with those values
The first element in the array should be the data, the second
should be the label
I can get the label set, but i Cannot get and set the "data"
the actually selected value.
For example: my function is
public function onResult_getSkillsetNames( result : Array ) :
void
skillsetName_cmb.dataProvider = result;
skillsetName_cmb.labelField = "skillsetName";
skillsetName_cmb.selectedItem = result[0];
skillsetName_cmb.text = result[1];
//skillsetName_cmb= results[0];

Look this post.
Combo Box dataField
Support
This may help you if you want to select another index than
the index of the dataprovider.
Best

Similar Messages

  • Hide a data column in combo box?

    I want to load a combo box from a database with two values per row (add.Item ?) but I only want one value to be see by the end-user.
    Example:
    Hidden | Shown
    12320  |  Green
    19210  |  Red
    72622  |  Yellow
    The user will see the colors but not the numeric values. The numeric values are actually the auto_id for each color in the database. I want to use the auto_id when I save the user's choice to another table instead of the color name.
    Right now as soon as the use selects a color I hit the database for the auto_id number - that can't be good.
    Thanks,
    ADawn
    ADawn

    Hello,
    You would set the data source for the ComboBox that has your data then set DisplayMember to the field to show in the ComboBox along with ValueMember set to the hidden field. Now say in a button click event use ComboBox1.SelectedValue to get the hidden field,
    cast as an integer if that is the data type of the hidden field.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • How to populate data in the data table on combo box change event

    hi
    i am deepak .
    i am very new to JSF.
    my problem is i want to populate data in the datatable on the combo box change event.
    for example ---
    combo box has name of the city. when i will select a city
    the details of the city should populate in the datatable. and if i will select another city then the datatable should change accordingly..
    its urgent
    reply as soon as possible
    thanks in advance

    i am using Rational Application Developer to develop my application.
    i am using a combo box and i am assigning cityName from the SDO.
    and i am declaring a variable in the pageCode eg.
    private String cityName;
    public void setCityName(String cityName){
    this.cityName = cityName;
    public String getCityName(){
    return cityName;
    <h:selectOneMenu id="menu1" styleClass="selectOneMenu" value="#{pc_Test1.loginID}" valueChangeListener="#{pc_Test1.handleMenu1ValueChange}">
                        <f:selectItems
                             value="#{selectitems.pc_Test1.usercombo.LOGINID.LOGINID.toArray}" />
                   </h:selectOneMenu>
                   <hx:behavior event="onchange" target="menu1" behaviorAction="get"
                        targetAction="box1"></hx:behavior>
    and also i am declaring a requestParam type variable named city;
    and at the onChangeEvent i am writing the code
    public void handleMenu1ValueChange(ValueChangeEvent valueChangedEvent) {
    FacesContext context = FacesContext.getCurrentInstance();
    Map requestScope = ext.getApplication().createValueBinding("#{requestScope}").getValue(context);
    requestScope.put("login",(String)valueChangedEvent.getNewValue());
    and also i am creating another SDO which is used to populate data in datatable and in this SDO in the where clause i am using that requestParam .
    it is assigning value in the pageCode variable and in the requestParam but it is not populating the dataTable. i don't no why??
    it is possible that i may not clear at this point.
    please send me the way how my problem can be solved.
    thanks in advance

  • Not able to populate data in the combo box

    Hi Guys,
    I m new to flex development and I want to populate the data
    coming from the databasein the combobox.I am able to get the length
    .but not able to populate the data.
    Can anyone helpme out?
    The code is below:
    The data displayed in the combox box is displayed as
    [object],[object] etc.I m sure that the data is coming from the
    database and its not populated in the combo box.any help is
    appreciated.
    private function getParkinfo(event:ResultEvent):void
    { Alert.show(event.result.length.toString());
    countries.dataProvider = event.result;
    <mx:ComboBox id="countries" />

    What does the data look like in the result? Is it XML? Post a
    sample of it.

  • Setting value in input combo box list of values programmatically.

    Hi,
    I have the following requirement.
    I have a combo box LOV defined in the column of application table. Whenever the user is trying to change this value, I need to check for a condition and invoke a warning popup with yes/no button and allow the user to change if dialog outcome is 'yes'. If the outcome is 'No', then i need to reset the combo box to its original value. To do this, in the valuechangelistener of LOV, I am invoking the warning popup and control will coming out of the valuechangelistener and dialog listener will be called.
    How do i set the combo box value in dialog listener ? and How do I retain the existing value of the LOV if user clicks on 'No' button.
    Jdev Version : Build JDEVADF_11.1.1.7.0_GENERIC_130226.1400.6493
    Thanks in advance.
    Harish

    You could, for example. store both of them (old value, along with new one) in the pageFlowScope. You can do that in the valueChangeListener (before calling popup), and use them in the dialog listener...

  • How do you set an array of combo boxes to a specific value?

    I have an array of combo boxes that I would like to set to a specific value. When I tell my program to set them it only sets the combo box that I most recently changed and none of the others. 
    I've attached a small vi that demonstates the problem. 
    Thanks, 
    --Ben
    Solved!
    Go to Solution.
    Attachments:
    ComboBoxProblems.vi ‏12 KB

    Your property node is for only one combo box (you can see this on the label and also by double clicking to go to UI element).
    If you want to change all of them then either follow previous suggestion or create a property node for the array and not just one of the combo boxes.

  • Load data in a combo box dynamically

    hello everybody!
    I need to load a combo box, depending on the selected data in another, eg by selecting the country and loaded societies selected country.
    Someone could guide whether this is possible, and if you have any examples that would be great.
    greetings

    user javascript events. "onload" and call some method so that it'll do your job(adding elements to combo).
    Edited by: Diablo_Chiru on May 15, 2008 4:35 AM

  • Need Help. Data jumps between Combo Boxes in an ADG

    I have an item renderer in an advanced datagrid.
    <mx:AdvancedDataGridColumn
        dataField="USE_TYPE_DESC"
        headerText="Use Type"
        rendererIsEditor="true"
        itemRenderer="renderers.tpUseTypeDropDown"
        editorDataField="getData"/>
    But the data that gets displayed in the combo boxes, appear to jump between CBs when you scroll the ADG up and down. The physical data is fine, its just the displayed data that is wrong.. Any ideas

    Ok, I tried this but still getting an error
    <cfquery datasource="mydb" name="test">
    Select name from mytable
    where
    <cfqueryparam value=#createodbcdate(edate)# cfsqltype="CF_SQL_DATE"> Between '01/01/2011' AND '01/01/2013'
    </cfquery>
    <cfoutput query="test">
    #ename#
    </cfoutput>
    now I get
    An error occurred while evaluating the expression:
    "#createodbcdate(edate)#"
    Error near line 3, column 53.
    Error resolving parameter EDATE

  • How can I set the size of combo boxes on a toolbar

    Hi, I am trying to use setMinimumSize of a combo box on a toolbar, It doesn't seem work. The code as following? Can anyone tell me how I can do it ?
    JComboBox sw = New ComboBox();
    sw.setMinimumSize(new Dimension(10,10));
    Thank you.
    Scott

    use the method preferred size of the JComponent superclass of the combos:
    setPreferredSize
    public void setPreferredSize(Dimension preferredSize)
    Sets the preferred size of the receiving component. If preferredSize is null, the UI will be asked for the preferred size.

  • Adf-Struts/JSP/BC4J- and setting date fields from jsp

    Hi,
    I'm working with the new ADF Frameworks (JDev 9.0.5.1) and ran into some questions regarding exception handling using BC4J, Struts and JSPs.
    I have a DATE column in database and an entity and VO with a datefield with type oracle.jbo.domain.Date.
    My JSP shows a textfield and the user should enter a valid date. Everything fine, until date is of wrong format or contains illegal characters...
    Problem:
    ADF tries to do a setAttribute on the datefield in VO row which expects a parameter with type oracle.jbo.domain.Date. When the user entered e.g. "NiceWeather" as date, I get an IIlegalArgumentException while converting to the correct Date format. This exception isn't thrown by bc4j as AttrValException and therefore my JSP renders a global error instead of a message directly behind the date field.
    I tried to validate the datefield in my DataForm and in my Action in the validateModelUpdates() method, but with no fitting solution.
    Any ideas how to validate a datefield with adf/struts/jsp/bc4j?
    Thanks for your help!
    Torsten.

    Torsen - In the first instance I'd recommed that you try and handle it declaritively using the Struts Validator Framework . See http://otn.oracle.com/products/jdev/howtos/10g/StrutsValidator/struts_validator_howto.html
    There is a section in there on how to use the validator with ADF databound pages and you can check the format the user enters via generated JavaScript.
    Also check out the matching sample project:
    http://otn.oracle.com/sample_code/products/jdev/10g/ADFandStrutsValidator.zip - this has a data field check on it as well

  • Binding Data to a Combo Box

    Using ODP.Net,
    Does anybody have sample code for binding a column in a table to a combo box in either a web form or in a window application in .NET 2003
    Thanks,
    Declan

    There's nothing special about doing this with ODP.NET.
    Any example of ADO.NET databinding should work with ODP.NET.
    eg
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvssamp/html/vbcs_RetreiveandProcessDatawithaSQLDataReader.asp
    or
    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=dotnet+databind+combobox
    David

  • How to set date field in custom form to default to {NOW} plus one year.

    I am developing a subscription site. I have the custom form for inputing a users information. I have the subscribe date set up as a default field of {NOW} that works great.
    Now I need the renewal field to default to exactly one year from the subscribe date.
    Any help would definitely be appreciated.
    thanks in advance

    PHP? http://us2.php.net/manual/en/function.date-modify.php
    Alec Fehl, MCSE, A+, ACE, ACI
    Adobe Community Expert
    AUTHOR:
    Microsoft Office 2007 PowerPoint: Comprehensive Course (Labyrinth
    Publications)
    Welcome to Web Design and HTML (Labyrinth Publications)
    CO-AUTHOR:
    Microsoft Office 2007: Essentials (Labyrinth Publications)
    Computer Concepts and Vista (Labyrinth Publications)
    Mike Meyers' A+ Guide to Managing and Troubleshooting PCs (McGraw-Hill)
    Internet Systems and Applications (EMC Paradigm)

  • Set Date field value through Form datasource

    Hello all,
    Has anyone set the value of a field of type Date through the form's datasource?
        If (Not Entrega = Nothing And NrDias > 0) Then
            Entrega = Entrega.AddDays(NrDias)
            ds.SetValue("U_data", ds.Offset, Entrega)
        End If
    End If
    If I change the field to a text field it write to the datasource and display no problem.
    Any ideias?
    Best regards.

    Ups,
    Found it.
    ds.setValue("U_dataent", 0, Entrega.ToString("yyyyMMdd"))

  • How do I duplicate the entry to a set of fields when a box is checked?

    I already know how to duplicate specific fields. I don't want the field duplicated if a certain box is unchecked (this would apply for a set of seven different boxes, that when the check box is selected, all seven fields would copy their respective matching fields).
    Example:
    Billed Address    vs.   Service Address
    Sometimes these are the same and sometimes they aren't. I need the option to copy the billed info to the service address if it is the same so I don't have to type in duplicate information.
    Thanks!

    Create 2 text fields and a check box.
    Use this as the mouse up script for the check box:
    if (event.target.value!="Off") {           //If checkbox is ticked
    this.getField("Textbox2").value = this.getField("Textbox1").value;         //Make the contents of the two text fields the same. Replace with the names of your fields.
    else this.getField("Textbox2").value = "";          //Clear Textbox2 if checkbox is not ticked

  • How to set the size of combo box  using jsf

    I face problem when i set the size of a combo in jsf

    Is it not possible to use it with a GridBagLayout?Your question was "How do I get a tabbed pane to take all the space of the frame"?
    You where given the answer. Did you try it? Did it work? Then why are you questioning the suggestion?
    Its one line of code if you use a BorderLayout which by the way was specifically designed for this purpose.
    Yes you can do it with a GridBagLayout with about 5 lines of code.
    So the question is why would you want to write 5 lines of code when you can use one?
    If your question was "How do I waste my time forcing the GridBagLayout to size a component to take up all the space of the frame", then you would have received a different answer. (Although most people would have told you to use a BorderLayout anyway, since its easier).

Maybe you are looking for

  • How can I use my 24inch 2007 iMac as display for my macbook pro?

    My 24 Inch OSX YosemiteiMac has mini display port and my OSX Yosemite Macbook Pro has a thunderbolt port. Is this possible? Thanks!

  • 2 things I don't see in Safari 5.1 that are essential to my browsing.

    2 things I don't see in Safari 5.1 that are essential to my browsing. 1) Where is the close button on the tabs? I have to use the command-w now! 2) Where is the show status? You know, when you mouseOver a link, it shows a preview of the link at the b

  • Multiple stylesheets per topic

    Hello, I like to create multiple stylesheets for management purposes, rather than having one very very large stylesheet which can be used for all topics in my help project. Is there any way RoboHelp can support multiple stylesheets per topic? I also

  • For direct activation of hierarchy, Aggregates have to be deactivated

    Hi, There are 2 monthly master data hierarchies loaded. We face some problem while loading the hierarchies. Now the 2 hierarchies are seen as Modified version. When I try to activate the hierarchies manually I receive the below message "For direct ac

  • Scan-to-email app

    Which printer does support the scan-to-email app? I discovered the photosmart 5510 doesn't support what are the alternatives?