Displaying value only in Drop Down List

Greetings,
I have a drop down list with value:text as follows:
01:Daylight
02:Dusk
03:Dawn
04:Night
I would like to present the user who clicks on the drop down list with all of the literal text options (daylight, night, etc), but once selected, the object populate and print only the value (01, 02, etc).
I thought about resizing the object when the user clicks on it, and then resizing it back once selected, but this seems rather cumbersome.  Space on the printed form is very limited, which is why the value/codes are used to represent the actual literal options.
Any methods or ideas would be greatly welcome
Thanks!
Brad

Here is a sample that shows what I think you want. I have a TextField that is displayed. When the user enters the field, I hide this field and make a DDlist available to the user. This DDList is placed behind the TextField and is hidden (not part of the layout) until the user enters the TextField. I also hide the TextField (this code is on the Enter event of the TextField). Now that the DDlist is visible you can set up a DDList to display one thing but report another. This is what I did (look at the binding tab of the DDList). Now when the user selects an item from the DDList the TextField is updated, the DDList is hidden and the TextField is made visisble, then the cursor is placed in the next field. This code is on the Exit event of the DDList.
Is this what you were trying to accomplish?
Paul

Similar Messages

  • Display pages that reacts to different values in the drop down list.

    I currently did up a simple drop down list that stores values retrieved from the database. I would like the program to display pages that reacts to the selected value without the press of any button, which means, if I select any value from the drop down list, the page will be displayed according to the value selected.
    Below are the codes that I did for the retrieval of data from the database.
    <%
            String username = "test";
            String password = "test";
            String thinConn = "jdbc:oracle:thin:@dbdev:1521:ORCL";
            Connection conn;
            Statement stm;
            ResultSet rs;
            String baseQuery ="SELECT DISTINCT ID FROM STAFF ORDER BY ID ASC";
            try {
                conn = DriverManager.getConnection(thinConn,username,password);
                stm = conn.createStatement();
                rs = stm.executeQuery(baseQuery);
    %>
    <strong>Retrieve ID from Database</strong>
        <select size="1" name="dropdown">
        <%
        while (rs.next()) {
            String id = rs.getString("ID");
            out.write("<option value=\"" + id + "\">" + "level " + id + "</option>");
                    conn.close();
                } catch (SQLException e) {
        %>
        </select>Would appreciate if someone might offer some help to what I have to do next
    Edited by: wyndsor on Jun 26, 2008 7:34 PM

    cotton.m wrote:
    [_An instant classic_|http://www.webdeveloper.com/forum/showthread.php?t=184937]
    Sometimes I find myself wondering why people think they won't get caught with their cross forum cross posting. Then I realize that if they knew about Google they wouldn't have needed to ask the question in the first place.
    It's kind of funny in an ironic sort of way.

  • The portlet name is not displayed in the portlet drop down list ?

    Hi,
    I use Sun Java System Portal Server 6 2005Q4 for windows 2000 server , use the following command to deployo portlet,
    I am not sure if I successfully deploy the portlet?
    pdeploy deploy -u amAdmin -w amadmin -p amadmin -d "cn=amldapuser,ou=DSAME Users,dc=icheng,dc=com" C:\Sun\PortalServer\tmp\portlet\portletsamples.war
    The message I got after execute the pdeploy command is =>
    Deploys the portlet war file and inserts the provider into display profile..
    OPTIONS
    --help Help message (false)
    -u --runasdn UID Bind DN (none)
    -w --password Password (none)
    -p --wc_password Password for WebContainer's Admin (none)
    -i --instance WebContainer's Instance into which the war file is to be deploye
    d (*)
    -d --dn LDAP DN of the target node (*)
    -g --global Global display profile (false)
    -r --rolesfile File containing the DSAME and portlet role mapping (*)
    -f --userinfofile File containing the user info mapping (*)
    -v --verbose Generate debug messages (false)
    -V --version Generate version information (false)
    -l --locale Locale information (en_US)
    OPERAND
    Specifies a path to the war location.
    Deploying to IWS
    Is this mean that successfully deploy the portlet ?
    After I deploy the portlet, I login to Access Manager, select the "service" from view, click the portal desktop,
    click "Manage Channels and Containers", click the "New Portlet Channel...", then click the portlet drop down list,
    the portlet name is not displayed in the portlet list.
    How can I make the portlet name displayed in the portlet drop down list ?
    Can someone help me ?
    Thanks!

    Hi
    According to your description, since this is SQL Server forum, as Olaf Helper’s post, could you get the correct result if you execute the following query in SQL Server Manager Studio (SSMS)?
    select UserName from aspnet_Users where UserId in(select FreindId from myFreinds where UserId in(select UserId from aspnet_Users where UserName = '<your typed name>'))
    If you cannot get the correct result in SSMS, I recommend to check the Transact-SQL statement. Apart from the error message, we also need to know the table structure, data, join relationships between tables for further analysis.
    However if there is no problem in SQL Server query, it will be an issue that regards ASP.NET and website deployment. I suggest you to post the question in the ASP.NET forums at
    http://forums.asp.net/ . It is appropriate and more experts will assist you.
    In addition, there is detail about listbox control in asp.net. You can review the following links:
    How to Bind/Load/Fill ListBox with Sql Server Database in asp.net:http://www.webcodeexpert.com/2013/07/how-to-bindloadfill-listbox-with-sql.html#.U5f75_6KCM9
    How to get multiple selected value in ListBox control - ASP.NET using C#:
    http://www.dotnetfox.com/articles/how-to-get-multiple-selected-value-in-listbox-control-Asp-Net-using-C-Sharp-1047.aspx
    Thanks
    Lydia Zhang

  • How to get selected value of a drop down list in CO?

    Hi All,
    Could you plz provide me the code for getting the selected value from the drop down list in CO?
    Thanks
    Debashree

    use pageContext.getParameter("paramName");
    Regards
    Srini

  • Restricting values on the drop down list, while creating a PO

    Hello SAP Experts,
       Could you help me with the following.
      While creating a PO (ME21N), based on the Account Assignment Category(KNTTP) entered , I have to restrict the values in the drop down list for selecting the material group (MAKTL). I have searched some in SDN, but couldn't find anything suitable. Appreciate any help.
    Thank you,
    Sorab

    Could anyone tell me , if it is possible. Has anyone tried this before.
    Thank you,
    Sorab

  • Using the values from a drop down list to display in a separate cell

    Hi all,
    I must apologise if I don;t use the right 'terminology' as I am just an ordinary guy who uses a mac. I am also deaf which means I am totally dependant on the internet for fixing solutions.
    Basically, I wanted to create a drop down list which I had no problem doing.
    In the drop down, I have the options One-Piece, Two-Piece and Three-Quarter.
    I would like to get it so that when I select the One-Piece, the value of 160 appears in a separate cell. If I select Two-Piece, then I would need 130 to appear in that separate cell. Likewise, Three-Quarter to produce 150.
    Just to clarify, if we had a two-column and one row table, then the drop-down would be in A1, which the values would appear in B1.
    I do not know the formula, and cannot find any instructions anywhere as I am probably using the wrong terminology or function name!
    Any help would be much, much appreciated..
    Carl

    I don't guess what I may add.
    The contents of the table named lookup appear on the screenshot.
    cell A1 contains the string One-Piece, cell B1 contains the 'associated' value 160.
    cell A2 contains the string Two-Piece, cell B2 contains the 'associated' value 130.
    cell A3 contains the string Three-Quarter, cell B3 contains the 'associated' value 150.
    Now table Main
    In column B the cells contain a pop_up menu with four items like the ones described by Jerrold.
    In column C of the cells contain the formula :
    =IFERROR(VLOOKUP(B,Tableau 2 :: A:B,2,FALSE),"")
    I enhanced it since yesterdays because I forgot to treat the case when cell is blank in column B.
    I apologize but as I'm using my machine in French, the screenshot display the French formulas.
    I repeat that you may find useful infos in the PDFs files which we may download from the menus:
    Help > Numbers User Guide
    Help > iWork Formulas and Functions User Guide
    As you are in Stoke-on-Trent maybe your system is set to use the comma as decimal separator.
    If it's that, you must replace the comma by semi-colons in the formulas (you may see them in my screenshot).
    Yvan KOENIG (VALLAURIS, France) mercredi 24 mars 2010 09:27:53

  • How to get Date value from database and display them in a drop down list?

    Hello.
    In my Customers table, I have a column with Date data type. I want to create a form in JSP, where visitors can filter Customers list by year and month.
    All I know is this piece of SQL that is convert the date to the dd-mm-yyyy format:
    SELECT TO_CHAR(reg_date,'dd-mm-yyyy') from CustomersAny ideas of how this filtering possible? In my effort not to sound like a newbie wanting to be spoonfed, you can provide me link to external notes and resources, I'll really appreciate it.
    Thanks,
    Rightbrainer.

    Hi
    What part is your biggest problem?? I am not experienced in getting data out of a database, but the way to get a variable amount of data to show in a drop down menu, i have just messed around with for some time and heres how i solved it... In my app, what i needed was, a initial empty drop down list, and then using input from a text-field, users could add elements to a Vector that was passed to a JComboBox. Heres how.
    package jcombobox;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    import javax.swing.*;
    public class Main extends JApplet implements ActionListener {
        private Vector<SomeClass> list = new Vector<SomeClass>();
        private JComboBox dropDownList = new JComboBox(list);
        private JButton addButton = new JButton("add");
        private JButton remove = new JButton("remove");
        private JTextField input = new JTextField(10);
        private JPanel buttons = new JPanel();
        public Main() {
            addButton.addActionListener(this);
            remove.addActionListener(this);
            input.addActionListener(this);
            buttons.setLayout(new FlowLayout());
            buttons.add(addButton);
            buttons.add(remove);
            add(dropDownList, "North");
            add(input, "Center");
            add(buttons, "South");
        public void actionPerformed(ActionEvent e) {
            if (e.getSource() == addButton) {
                list.addElement(new SomeClass(input.getText()));
                input.setText("");
            } else if (e.getSource() == remove) {
                int selected = dropDownList.getSelectedIndex();
                dropDownList.removeItemAt(selected);
        public void init(String[] args) {
            setSize(400,300);
            getContentPane().setLayout(new BorderLayout());
            getContentPane().add(new Main());
    }And that "SomeClass" is show here
    package jcombobox;
    public class SomeClass {
        private String text;
        public SomeClass(String input) {
            text = input;
        public String toString() {
            return text;
    }One of the things i struggled a lot with was to get the dropdown menu to show some usefull result. If the list just contains class references it will show the memory code that points to that class. Thats where the toString cones in handy. But it took me some time to figure that one out, a laugh here is welcome as it should have been obvious :-)
    When the app is as simple as this one, using a <String> vector would have been easier, but this is just to demonstrate how to place classes in a vector and get some usefull info out of it, hope this answered some of your question :-)
    The layout might have been easier to write, than using the toppanel created by the JApplet and then the two additional JPanels, but it was just a small app brewed together in 15 minutes. Please comments on my faults, so that i can learn of it.
    If you need any of the code specified more, please let me know. Ill be glad to,

  • Get/Set values from a drop down list

    I am trying to modify the http://www.netbeans.org/kb/60/web/web-jpa-part2.html so that instead of entering the data from a text field (in update & add) the values come from a drop down list from a table. I have drop down lists that are populated bothe from the DB and hard coding. When I run, I am able to see the options on the DDs. But none of the CRUD work. I think this is because my set and get for the drop down is wrong. Then again, I also have a few text fields from the original example which also don't seem to work. Here is a piece of my addButton():
            RowKey[] selectedRowKeys = getTableRowGroup1().getSelectedRowKeys();
            PaymentDetails[] pv = getSessionBean1().getPaymentVoucher();
            int rowId = Integer.parseInt(selectedRowKeys[0].getRowId());
            PaymentDetails upPV = pv[rowId];
            bankCodeDD.getSelected();
            statusDD.getSelected(); // hard coded value
          upPV.setPrepBy((String) prepByField.getText());
          PaymentDetailsController pvController = new PaymentDetailsController();
            pvController.addPaymentDetails(upPV);
            addRequest = false;
            return null;How do I set and get the values from the drop down so than it passed to my bean? When I choose a row to be updated, make changes and click Update, I get this message on my Tomcat:
    com.sun.webui.jsf.component.DropDown::The current value of component form1:deptCodeDD does not match any of the selections.
    Did you forget to reset the value after changing the options?Can someone please point me to a place which shows how I can add a default value from my DD? I tried to follow http://www.netbeans.org/kb/55/dropdowncomp.html, but unable to complete because I get an error for Options api. The auto-fix imported import org.apache.jasper.Options; But the package given in the tutorial is com.sun.webui.jsf.model.Option. My Java version is 1.6.0_07.
    private Options listOptions[];
    ...//getter setter goes here
    listOptions = new Option[noofDBRows + 1];Many Thanks!

    I don't guess what I may add.
    The contents of the table named lookup appear on the screenshot.
    cell A1 contains the string One-Piece, cell B1 contains the 'associated' value 160.
    cell A2 contains the string Two-Piece, cell B2 contains the 'associated' value 130.
    cell A3 contains the string Three-Quarter, cell B3 contains the 'associated' value 150.
    Now table Main
    In column B the cells contain a pop_up menu with four items like the ones described by Jerrold.
    In column C of the cells contain the formula :
    =IFERROR(VLOOKUP(B,Tableau 2 :: A:B,2,FALSE),"")
    I enhanced it since yesterdays because I forgot to treat the case when cell is blank in column B.
    I apologize but as I'm using my machine in French, the screenshot display the French formulas.
    I repeat that you may find useful infos in the PDFs files which we may download from the menus:
    Help > Numbers User Guide
    Help > iWork Formulas and Functions User Guide
    As you are in Stoke-on-Trent maybe your system is set to use the comma as decimal separator.
    If it's that, you must replace the comma by semi-colons in the formulas (you may see them in my screenshot).
    Yvan KOENIG (VALLAURIS, France) mercredi 24 mars 2010 09:27:53

  • How to set a default value for a drop down list box and then apply cascading based on the default value in Infopath 2010.

    Hello Everyone
    I have two drop downs. Both are coming from look up fields from two lists. i want to set a default value(first list item) for the first drop down list box and then apply cascading based on the default value for the next drop down list box. I found one article(http://www.bizsupportonline.net/infopath2010/display-first-item-drop-down-list-box-infopath-2010.htm)
    where in i can set a default value but i can't apply cascading based on that default value. Any suggestions would be highly appreciated.
    Thanks
    Ramanjulu Naidu N

    Hey Ramanjulu,
    Take a look at the below article which I believe will answer your question.
    http://basquang.wordpress.com/2010/03/29/cascading-drop-down-list-in-sharepoint-2010-using-infopath-2010/
    Daniel Christian (MCTS)

  • Drop down list value dependant on value in another drop down list

    Hi
    I am not familiar with Java Script so if anyone can advise me on this I would be grateful.  I am using ADobe Livecycle V8.0.
    I have two drop down lists - DDL1 and DDL2.
    The choices in DDL1 are "High, Medium, Low, None"
    The choices in DDL2 are "Positive, Negative, None"
    If "None" is selected in DDL1 I want DDL2 to display "None". 
    If any of the other values are selected in DDL1, then I don't want anything autofilled in DDL2.
    Hope this makes sense!
    Thank you.

    This should do the trick:
    in the "change" event of DropDownList1, put this:
    if (xfa.event.newText == "None"){
    DropDownList2.selectedIndex = 3; // at pos. 3, you should have "None"
                                                           // otherwise change here at your convenience
    else {
    DropDownList2.selectedIndex = 0; // here first element empty/default
                                                            // maybe you prefer the last one
    Note that generally dropdown boxes have the first or last element empty/default; this way, when you script the "else" part, you can easily reset DropDownList2.

  • Displaying user selection from drop down list in static text on master page

    Hello,
    I am using LC 7.0 at workk and I have hit a road block.
    I have a drop down list at the top of the form. Once the user makes a selection, I want to take that value and paste it in static text located on the master page. I can't seem to get it to work.
    Please help!!!

    Hi,
    Place the Drop Down list on form
    Place text object(s) on master page
    here is the script to display the value and/or text of drop down
    Script will be on Drop Down list events
    Calculate event to display value of DD - FormCalc
    form1.pageSet.Page1.StaticText1.rawValue = this.rawValue;
    Change event to display Text of DD - JavaScript
    form1.pageSet.Page1.StaticText2.rawValue = xfa.event.newText;
    SAVE the form as dynamic pdf.
    Hope this will help.
    Thanks,
    Raghu.

  • How to Pre-select Value in auto drop down list

    Hi,
    I have an automatically populated drop down list, and I'm trying to have it display with a pre-selected value (in the example 5). I didn't know where to start, so I modified the Dreamweaver code for "Set value equal to" from the Dynamic list function.The list displays, but the value defaults to 0. What am I missing?
    <?php
    echo '<select name="firstnumber" id="number">';
    for ($j=0; $j<11; $j+=1)
    echo  "<option value=\"$j\" <?php if (!(strcmp(\"$j\",5))) {echo \"selected=\"selected\"\";} ?>$j</option>\n";
    echo '</select>';
    ?>
    Thanks,
    Tim

    The problem is that you have nested PHP tags inside a PHP block. You can't do that. In fact, it's surprising that the code works at all. Normally, nesting PHP tags inside a PHP code block will trigger a syntax error.
    Also, your code is very difficult to read because of the way you use double quotes all the time. It's best to use single quotes for strings, except when you need to display the value of a variable inside a string. You can also nest double quotes inside a single-quoted string and vice versa, making for code that's much easier to read without all the backslashes.
    This is how I have rewritten your code:
    <select name="firstnumber" id="number">
    <?php
    for ($j=0; $j<11; $j+=1) {
      echo  "<option value='$j'";
      if (!(strcmp($j,5))) {
         echo 'selected="selected"';
      echo ">$j</option>\n";
    ?>
    </select>

  • Adobe LiveCycle Drop Down List which allows typing to filter the values in a Drop Down list

    I have a drop down list in my form with contains a lot of different numbers, text, countries, cities and states, etc.
    I would like the user to either have the option to only use the drop down list or they can type "Zapple" or any portion and have it populate the value.
    Is there a setting or code which I can use which will do this?
    Currently, if the user types the first letter or number it will take them to the beginning of the list (since I have them listed alphabetically/numerically), but I'd prefer they can type beyond the first character and pinpoint the option they're looking for.
    Thank you for any help

    The whole sample will need to be updated. As I said in the email it can be done but it will be complex. This particular sample requires an external xml file. You will need to pull this from data in the form.

  • How to make default value in a drop down list

    Hi,
          I have created a drop down list using Selection-Screen code. I have three values in it. I would like to make one of the option as a default value. How to achieve it?
    I am working on module pool program. I have few screens as a part of my program. I have created print button on tool bar of one screen but that print button is appearing on the other screens too. How to avoid it?
    Help would be appreciated...
    Thanks
    Edited by: mohammed ibrahim on Oct 10, 2008 8:43 PM

    1) let drop down box be g_dd.
      if g_dd is initial.
      g_dd = option2.
      endif.
    2)
    by default same pf-status is used by all the screens in the same program
    if sy-dynnr = 'screen_no'. " for screens for which you do not want button to come
    set pf-status 'abc' excluding 'fcode_of_button'
    endif.
    or
    data: git_fcode type sy-ucomm with header line.
    git_fcode = 'fcode_of_button'.
    append git_fcode.
    if sy-dynnr = 'screen_no'. " for screens for which you do not want button to come
    set pf-status excluding git_fcode
    endif.
    Edited by: Amit Gupta on Oct 11, 2008 11:36 AM

  • How to populate the values in the drop down list form the xml file ?

    I want to populate the drop down list values from a seperate xml file called ReferenceData. I created this file, which consists of a mapping entry in the form of ( key,value ) pair. Am mapping this xml file in to form by using rule named as getAppReferenceData.
    But the values are not getting populated in the form. And I have a doubt of, where should we keep that xml file? (under which path / folder ).

    what would help is if you showed what you do in the rule, either the code or a express trace of the rule.
    The other thing you need to know is where you want to get the file from. Yes java can read a file from anywhere on the system but there is a security layer in there which might prevent the file being opened. Have you allowed acces to the file via the security policy settings via java.io.FilePermission?
    WilfredS

Maybe you are looking for

  • AP Payment terms ( discount )  end on week end

    Hi Gurus I have a situation where payment terms for an invoice falls on Saturday.So when when we run it on following Monday it disallow the discount ( 2% ). We pay manually with 2% discount.How can we resolve this issue of discount date falling on we

  • How do I consolidate multiple itunes accounts?

    Over the years I have somehow ended up with music purchases associated with different email accounts. I think I might have multiple appleid's.?? I think one Id has me on 4 of 5 computers and the other on 2 of 5. I want to start over without losing al

  • What if I want to link to an image on an external site, such as Pixentral or Flickr, instead of uploading the image to the Forum server?

    Flickr's Terms of Service  state that if you post an image hosted on Flickr on another site you have to  link back to the image page on Flickr. To do that you  need to go to your image  on Flickr, click on the All Sizes link above the image,  select

  • Migration to NW7.11

    Hi, Maybe you can help me. I am migration RWBS application based on WD for Java to NW7.11 and I am facing some copiling errors: For example: Code in NW7.0: import com.sap.tc.webdynpro.services.sal.datatransport.core.IInputMassDatasource; import com.s

  • HDD size reporting

    I noticed a lot of queries over the years about Finder and About This Mac reporting inaccurate files sizes and the mystery surrounding just what 'Other' meant exactly. Well, I am glad to say I have some answers for those still suffering: 1. 'Other' c