Get combo box display name

HI,
I have <h:selectOneMenu on my application is there a way to get the display name out of the combo box
I can get the value OK.
thanks

The option label you mean? No, those aren't sent as request parameters. Only the currently selected option value will be. But why would you ever need to get it as request parameter? Usually you already know the value-label pairs in the server side. Just have some Map<ValueType, LabelType> in the backing bean, display it as dropdown list using f:selectItems and in the action method you can just get the label by selected value. Whyever you need the label for.
That said, a "combo box" is a technically wrong term in this case. It's actually a "dropdown list". A combo box is a manually editable dropdown list. The h:selectOneMenu isn't, it's a fixed dropdown list.

Similar Messages

  • Combo box displays value instead of label

    I have several combo boxes on a vi that will occasionally start displaying the value of an certain items instead of the string label when an element is selected. The only way to fix it is to deleted the combo box and replace it with another. This has happened several times on the same vi. Sometimes it is ok when the vi is run in the IDE but shows up in an executable. Is this a bug?
    Thanks,
    Bill F

    I think this is to be expected. Your control will have a value with no associated text.
    It would be much more dangerous if LabVIEW would randomly change (e.g. coerce) the value when the strings array gets shorter by some mechanism.
    You have several possibilities, for example:
    (1) Check the value and coerce to the highest valid entry or switch to entry zero.
    (2) Keep the array of strings at constant size, but replace the unwanted entries with empty strings (see attached), the string "out of range", "invalid selection", or similar.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ComboMOD.vi ‏24 KB

  • Silver Combo Box Display Style Bug

    [LV2011, Windows XP]
    There appears to be a small bug with the Silver-style Combo Box control when you right-click and select Visible Items->Display Style.  For the string control a glyph appears properly, but for the combo box the glyph appears in the wrong place, and the colours are wrong.  In fact, the glyph only appears properly if you click on it, or do something else to force a redraw of the control.
    This combo box is a bit confusing, since it has no "Radix Shadow" part like the string control does, and in fact only the Silver-style combo box lets you display the "Display Type" glyph.  The other styles of combo box have no "Display Type" feature in the "Visible Items" menu, but the "Display Style Visible" checkbox does appear on the "Appearance" tab of the Properties dialog box (though checking it has no effect, and it appears unchecked if you re-launch the dialog box".
    I've attached a new version of the control which is close to fixing the bug, but the glyph region is 1 pixel skinnier than the string version.  Copy this to your "..\vi.lib\silver_ctls\String" folder if you want it to replace the version in the palettes.
    Jaegen
    Solved!
    Go to Solution.
    Attachments:
    Combo Box NI_Silver.ctl ‏6 KB

    Jaegen:
    Good catch, there is now a Corrective Action Request filed for this issue. It is correct that this property is
    not supported by the Combo Box found in the Modern Palette. However, this should at least be documented in the
    "Display Style Visible" property documentation if this is case, which it is not.
    Thanks for alerting us to this error and if you would like to follow the CAR, look for CAR# 312717 listed in
    bug fix reports for later releases of LabVIEW.
    Please let me know if you have any questions or need any more help with this issue.
    Tori W.
    National Instruments

  • Powershell How to get person field display name

    I am running the following ps script to get some data out to csv. The person fields (AssignedTo and CreatedBy) come with index;#LastName, FirstName. How do just get the name without the index stuff. Or do I need to do a Regex or Replace? For example,
    32;#Doe, John Should be Doe, John
    $results = @()
    $web = Get-SPWeb "http://ourlocal.company.cc/docs/sales"
    $list = $web.Lists["Sales Tasks"]
    $caml = '<Where><Eq><FieldRef Name="Status" /><Value Type="Choice">Completed</Value></Eq></Where>'
    $query=new-object Microsoft.SharePoint.SPQuery
    $query.Query=$caml
    $ListItems=$list.GetItems($query)
    Write-Host "count " $ListItems.Count
    foreach ($item in $listItems)
    $Title = $item["Title"]
    $AssignedTo = $item["AssignedTo"]
    $Status = $item["Status"]
    $Priority = $item["Priority"]
    $CreatedBy = $item["Created By"]
    $out = new-object psobject -Property @{Title = $Title
    AssignedTo = $AssignedTo
    Status = $Status
    Priority = $Priority
    "Due Date" = $DueDate
    "Percent Complete" = $Percent
    "Created by" = $CreatedBy}
    $out = $out|select-object Title, AssignedTo, Status, Priority, "Due Date", "Percent Complete", "Created by"
    $results +=$out
    $results | Export-Csv "c:\output.csv" -noType
    $web.Dispose()

    Step 1:
    Add following code right after $CreatedBy=$item["Created By"]
    $CreatedByUserObj = New-Object Microsoft.SharePoint.SPFieldUserValue($web, $CreatedBy)
    $CreatedByDisplayName = $CreatedByUserObj.User.DisplayName;
    Step 2:
    Replace "Created by" = $CreatedBy with following code
    "Created by" = $CreatedByDisplayName

  • Ways to get combo boxes, etc. on MIDP devices

    I'm writing a MIDlet that I want to be very device-independent. So I'm trying to stick solely to the J2ME rudimentary interface classes.
    However, I really need to have combobox and listbox functionality. Nextel and others have libraries you can use for this, but then I'm not device-independent.
    Any thoughts, is anyone else wresting with this design issue?
    Are there combo and listbox classes that are made using the std J2ME portable foundation?

    I found an API on the web but don't remember which one - it is not free, though - but it uses the low-level API of MIDP to create those buttons and boxes.

  • How to get Airport Utility display name of connected devices ?

    Hello,
    I would like to see what devices are connected on my Time Capsule.
    Usually, Airport Utility  shows:
    - MAC address, IP address and client ID in DHCP tab
    - MAC address in wireless client tab with signal level plotted on graphic
    So, it's a little awkward, but you can assume that:
    - wired devices are connected if they show in DHCP tab
    - wireless devices are connected if they show in Wireless client tab. Then you can assume what wireless device it is, using the MAC address as identifier and reading client ID
    Usually client ID are plain readable, like "iPhone Bob", "Mac of Sarah", etc...
    Sometimes there is a third party manufacturer cryptic info.
    Sometimes there is nothing. For example with my Canon printer
    With time, i've learned to know what MAC address my devices are, and consigned them in a list; but i found it painful to go to my list of devices and retrieve them with their MAC adresses. I would like airport utility to make this association, like they do for apple devices
    So my question is:
    Is there any file that i can edit to associate the Mac address of the device with the name i want ?
    I suppose there might be some hosts file somewhere ?
    thanks

    I've found an xml config file in ~/library/application Support/Apple/Airport/
    There is a
                                                      <key>hostname</key>
                                                      <string>Canon Printer</string>
    missing, that I have added. Now all DHCP devices have disappeared in Airport utility (but are still connected); i guess they will reappear once the dhcp bail has been renewed, (in one day) but that won't change anything, as this xml file is likely an output, not an input.
    I'll keep you posted

  • Get sender's display name of a mail seem has a bug

    if a mail from a sender, he name like this: Jack (NSNA)
    using api get_sender(), then get_DisplayName() will return NSNA.
    if he name like this: Jack NSNA(
    that make more weird, will return name of recipient. :(

    HI,
    *"As far as I am aware this is not possible in Mac Mail and is a major shortcoming considering that other mail applications are able to do this."*
    You can provide feedback ..
    http://www.apple.com/feedback/macosx.html
    Carolyn

  • VBA Userforms – Getting errors when item from combo box is not selected

    Hi there
    Thank you in advance for taking the time to check this out.
    Objective:
    I have 2 combo boxes, one is dependent on what has been selected in the first combo box (dynamic named range), they work fine except for an irritating error when the user accidentally clicks in the empty
    Cmbox_IncCategory and it won’t allow the user to go back to the
    cmbx_Category_Type box if the user forgot he had to make a selection from that first before selecting the
    Cmbox_IncCategory.
    The error that pops up is “Invalid property value”.
    I tried having text in there to say “please select from Cmbox_IncCategory first, but that didn’t fix it.
    I tried to ‘If error resume next’ but that didn’t like it either. Now I am stumped.
    Main combo box= cmbx_Category_Type
    2nd combo box (displaying a list dependent on what was selected in Main combo box)= Cmbox_IncCategory
    I know there must be a way to fix it so that if a user clicks on the combo box, but doesn’t make a selection it won’t lock up the form.
    Yes, it is a mandatory field, and I was considering using a message box to advise the user that this must be completed, but I am not sure how to do it (and avoid the errors
    Here’s the current code I have for the combo boxes.
    Me.Cmbox_IncCategory = "" 'Clears the contents of the 2nd combobox when another category is chosen
    On Error Resume Next
    'I can't seem to have the Incident Category combobox to be empty when the form is open _
    I have tried Cmbox_IncCategory.Value = "", but I get an error. I then tried Cmbox_IncCategory.text = "" _
    but also get the error. I don't know how else to get it to work .. I tried both codes in the _
    form_initialize, but get an error ... I'm stumped !
    Select Case Me.cmbx_Category_Type
    Case "Crime"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_CRIME"
    Case "Property Damage - Minor - NS"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_PROPRTY_NS"
    Case "Property Damage - Significant - S"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_Proprty_S"
    Case "Safety"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SAFETY"
    Case "Security Breach"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_BREACH_S"
    Case "Support"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SUPPORT"
    Case "Vehicle"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_VEHICLE_S"
    End Select
    End Sub
    I’d be really grateful if someone could help me out, or perhaps direct me to where I might find some coding that will achieve the result I am seeking.
    This links to
    My Sample form
    With much gratitude,
    TheShyButterfly
    Hope you have a terrific day, theShyButterfly

    Hi Peter,
    Thank you for your quick response :) Brave man! :)
    Both combo boxes are blank to start with (because nothing has been selected). If I click on the first combo box (cmbx_Category_Type) which lists the main events/category types, but I don't select any thing, and I click in the secondary box
    (Cmbox_IncCategory) and then click on any other control, I get an “Invalid property value” error. When I click OK on the error (a few times) and I return to the code window, it gives no indication where/what is breaking
    the code/causing the error. I have no choice but to exit the form by stopping in the code window.
    If I click on the first textbox, (cmbx_Category_Type), and then do the right thing and make a selection, then I have no problems with the secondary textbox (Cmbox_IncCategory).
    As I am not that up on VBA I am trying to follow your instructions... I have changed the code as follows, removed and replaced the rowsource name, but I encounter the very same problem.
    When I changed my code from Me.Cmbox_IncCategory="" to yours myCombo.ListIndex = -1  (changing the combo box name to reflect my combo box name) and adding the second line of code ...
    Me.Cmbox_IncCategory.ListIndex = 0 I still got the same behaviour and error.
    I even tried moving each row of the named rows down one row (so that there would be a 'blank' row which could be selected to get out of trouble, but it wasn't very successful either.
    Have you opened my form to see what happens, I included the link so whoever was looking at my problem (and yes, I have many I know), could see for themselves what it is doing/not doing.
    The code now reads as below (is this what you meant?) - the results were as I mentioned above.
    Me.Cmbox_IncCategory.ListIndex = -1 'Clears the contents of the 2nd combobox when another category is chosen
    Me.Cmbox_IncCategory.ListIndex = 0
    ' On Error Resume Next
    'I can't seem to have the Incident Category combobox to be empty when the form is open _
    I have tried Cmbox_IncCategory.Value = "", but I get an error. I then tried Cmbox_IncCategory.text = "" _
    but also get the error. I don't know how else to get it to work .. I tried both codes in the _
    form_initialize, but get an error ... I'm stumped !
    Select Case Me.cmbx_Category_Type
    Case "Crime"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_CRIME"
    Case "Property Damage - Minor - NS"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_PROPRTY_NS"
    Case "Property Damage - Significant - S"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_Proprty_S"
    Case "Safety"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SAFETY"
    Case "Security Breach"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_BREACH_S"
    Case "Support"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SUPPORT"
    Case "Vehicle"
    Me.Cmbox_IncCategory.RowSource = "Inc_Cat_VEHICLE_S"
    End Select
    End Sub
    I appreciate your patience :) I am growing in knowledge, but its a slow process. Please let me know if there is anything else I can help clarify for you :)
    This links to
    My Sample form
    Thanking you again
    TheShyButterfly
    Hope you have a terrific day, theShyButterfly

  • How to programatically display text in combo box?

    Is there a way to programatically display text in a combo box.  I would like to display the word "Select" in the combo box each time my program starts.  As it is now, my combo box displays the last string that was selected the last time the program ran.
    Thanks in advance.
    Solved!
    Go to Solution.

    Actually, after actually reading your post...
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • Display issue with Combo Boxes and Logo

    Hi All,
    I am facing a couple of issues with my dashboard:
    1. Combo boxes display - I have placed a series of combo boxes one below the other. During the preview, when I click on the first combo box, the values spread below. That is, the labels, and options of the next combo box are also visible. The options in the combo box are not seen clearly. I have tried many permutations and combinations with "Bring Forward +" and "Send Back -" but none of them seem to work. For example, keeping the first combo as bring forward and next one as send back etc. Can you please help me in this regard?
    2. Logo - I have used image component and embedded a logo from my local system. Later I saved the xlf in the repository. When I import the xlf from the platform, it displays the logo fine. But however, this behavior is not constant. It sometimes doesn't show the image. Do I have to save the image also in the repository? or in a common shared folder? If I embed the logo does it not mean that the xlf hold the copy?
    Any help in this regards is highly appreciated.
    Thanks and regards,
    Sandeep.

    Hi:
       For your question
    1) Do you need your combox overlapped? I tried to overlap my comb box and preview it, seems works fine for me. it only chooses the first comb box. But I am suggesting that if you want to show/hide the different combox in the same position at run time, you can try to control the visibility by some other component.
    2) The answer is NO, the image embedded in the image component will be saved to xlf file, there is no need to save it individually. Try to clean your cache files in your machine and do it again.
    Hope it helps.

  • 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

  • Need help on combo box problem

    hi ,
    i have two combo box..... eg..c1,c2
    i retrieved data from database to display it in combo box c1.now my problem is using the selected value from combo box c1 i have to display the respective value in c2..
    eg.
    if Product type=injection (in combo box c1)
    then
    in c2 the product name for injection available should be displayed by retrieving it from database...
    this is my code
    <%
    //query for selecting the values from the database
    stm=con.createStatement();
    ResultSet rs=stm.executeQuery("select Dosageform from ProductMaster");
    %>
    <!-- Displaying the values in the combo box -->
    <form name="form1" method="post" action="">  <select name="eid" id="eid" onchange="display(this)">
    <%
    while(rs.next())
    %>
    <OPTION VALUE=""><%=rs.getString("Dosageform")%></OPTION>
    <%
    %>
    </select>
    <select name="combo2">
                   </select>i don't know how to write the function display for this....
    can any one help me...
    Thanks
    kalai

    hi
    thanx to all who sees my forum.
    now i was able to create a depenent box but now i'm facing two problems
    1. when i submit the form my previous value from the combo box is not selected
    2. when i first load the page the value in the 2nd combo box doesn't has the value as null...
    my code
    function display()
      var index=document.form1.drug.value;
      document.form1.hid.value=index;
      form1.submit();
    function refresh()
       var val;
       val=document.form1.hid.value;
       drug.SelectedIndex=value;
    <div class="tr1">
    <td>Product Name</td>
    <%
    //query for selecting the values from the database
       rs=stm.executeQuery("select DrugName from ProductMaster");
    %>
    <!-- Displaying the values in the combo box -->
    <form name="form1" method="post" action="">
    <select name="drug" id="drug" onChange="display()">
    <option value="">-- select -- </option>
    <%
    while(rs.next())
    %>
    <OPTION VALUE="<%=rs.getString("DrugName")%>"><%=rs.getString("DrugName")%></OPTION>
    <%
    %>
    </select>
    <input type="hidden" name="hid">
    </div>
    </tr>
    <tr>
    <div class="td1">
    <td>NDC code #</td>
    <%
    //query for selecting the values from the database
    String sql1 = "SELECT ProductCode from ProductMaster where DrugName='"+request.getParameter("hid")+"' ";
    rs=stm.executeQuery(sql1);
    %>
    <SELECT NAME='ndc'>
    <% while (rs.next())
    String val1=rs.getString("ProductCode");
    out.println ("<OPTION VALUE='" + val1 + "'>" + val1 + "</OPTION>");
    %>
    </div>i don't know wht to do...
    pls help me as soon as u can...
    Thanks & Regards
    kalai

  • Need help on Combo Box

    Hi,
    I am currently developing a application using Flex. In my
    application i am using ComboxBox but i am not able to adjust the
    spacing between the values present inside the combobox. currenlty
    when the clicks on the combo box even thought there are two values
    the height looks very big. Is there way i can control it.

    hi
    thanx to all who sees my forum.
    now i was able to create a depenent box but now i'm facing two problems
    1. when i submit the form my previous value from the combo box is not selected
    2. when i first load the page the value in the 2nd combo box doesn't has the value as null...
    my code
    function display()
      var index=document.form1.drug.value;
      document.form1.hid.value=index;
      form1.submit();
    function refresh()
       var val;
       val=document.form1.hid.value;
       drug.SelectedIndex=value;
    <div class="tr1">
    <td>Product Name</td>
    <%
    //query for selecting the values from the database
       rs=stm.executeQuery("select DrugName from ProductMaster");
    %>
    <!-- Displaying the values in the combo box -->
    <form name="form1" method="post" action="">
    <select name="drug" id="drug" onChange="display()">
    <option value="">-- select -- </option>
    <%
    while(rs.next())
    %>
    <OPTION VALUE="<%=rs.getString("DrugName")%>"><%=rs.getString("DrugName")%></OPTION>
    <%
    %>
    </select>
    <input type="hidden" name="hid">
    </div>
    </tr>
    <tr>
    <div class="td1">
    <td>NDC code #</td>
    <%
    //query for selecting the values from the database
    String sql1 = "SELECT ProductCode from ProductMaster where DrugName='"+request.getParameter("hid")+"' ";
    rs=stm.executeQuery(sql1);
    %>
    <SELECT NAME='ndc'>
    <% while (rs.next())
    String val1=rs.getString("ProductCode");
    out.println ("<OPTION VALUE='" + val1 + "'>" + val1 + "</OPTION>");
    %>
    </div>i don't know wht to do...
    pls help me as soon as u can...
    Thanks & Regards
    kalai

  • Wrong email display name with german umlauts (MS Exchange 2003)

    We use 6 iPhones with Exchange 2003 and get wrong email display names with german umlauts (ä,ü,ö) - but the email-body is right.
    We get special characters instead of umlauts, so the display name split into pieces. Anwering is not posipble - we get a failure-message.
    We changed the standard-internet-mailformat on the exchange-server to unicode utf-8. First it works fine, after a few hours the names displays wrong again.
    So we use this hotfix:
    http://support.microsoft.com/?scid=kb%3Ben-us%3B916299&x=11&y=13
    Same result: First it works fine, after a few hours the names displays wrong again at the iPhone.
    Any ideas?

    Do you have commas in the display name? We used to have "Müller, Thomas" <[email protected]> and then got the split up and special characters you mention. Tests have shown that when leaving out the comma in the display name, e.g. "Thomas Müller" <[email protected]>, everything worked fine.
    Guess it's a question of whether a company wants to change its naming convention for a few iPhone users...
    HCD

  • Combo box ( i can't solved. help me)

    hi, i have doubt in combo box
    <select name="branch">
    <option>chennai</option>
    <option>bangalore</option>
    <option>delhi</option>
    <option>mumbai</option>
    </select>
    In the above code i didn't use <option value> but i give the values between the <option>xxxx</option>tags.
    Now i want to retreive the values between the <option></option> tags.
    is it possible?.if yes how?. please send me code. it would be very helpful to me.

    linta mam..try this..
    I hope u know how to write js functions..
    write a function for onChange event of ur select ..
    inside the function u can give
    var index=document.getElementById("branch").selectedIndex;
    alert(document.getElementById("branch").options[index].text)

Maybe you are looking for

  • Concepts in web dynpro abap

    concepts in web dynpro abap? how different is it from abap

  • Financial reports- Calculations

    Hi In HFR .....In Row1 i have GEn2 members which expand dynamically. The number of rows are limited to 20 members by conditional suppression... Now these 20 members values have to be divided by their total to get the %... How can i do it dynamically

  • Can't get rounded LineBorder in JPanels

    I cannot get rounding in a LineBorder on a JPanel. Anyone have any suggestions. Here's my code. The corners stay square in 1.4.2 and 1.5 in Win XP. LineBorder b = new LineBorder(Color.black, 1, true);

  • Price not correct

    The prices on my ITunes store is incorrect. It says each song is 8.00Kr. I didn't switch anything different about the Itunes, just downloaded the new version of it. I don't want to buy anything in fear of it giving me the wrong price. Thank you!

  • SAPGUI - cantch error messages.

    Hi, We would like to whether there's a way to catch SAP messages (mainly error) instead of looking in the SAPGUI. We developed a product ([sap error message solution|http://steeryou.com/solutions/das]) that helps user to solve SAP error and we found