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

Similar Messages

  • 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

  • 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

  • Getting the value from a Drop Down Box

    I'm working on a database project to keep track of our Blackberrys. The problem I'm having is entering the values for two drop down boxes. The page I'm working on enters the FirstName, LastName, Department, and Location. Department and Location have thier own Primary Keys and are foreign keys in the Person table. Departments and Locations are aligned by numbers like 1 = Ohio, 2 = Chicago. They
    don't automatically increase. The problem I'm having is entering them as a foreign key in the Person Table. I'm not sure if I use a getValue or getSelected or some other code to get the values to populate in the Person Table. I just keep getting a can't add department or location to table.
    public String newUser_action() {
    // TODO: Process the button click action. Return value is a navigation
    // case name where null will return to the same page.
    if (personDataProvider.canAppendRow()) {
    try {
    RowKey rowKey =
    personDataProvider.appendRow();
    personDataProvider.setValue(
    "DBO.PERSON.FIRSTNAME", rowKey,
    firstName.getText());
    personDataProvider.setValue(
    "DBO.PERSON.LASTNAME", rowKey,
    lastName.getText());
    personDataProvider.setValue(
    "DBO.PERSON.DEPTID", rowKey,
    department.getSelected());
    personDataProvider.setValue(
    "DBO.PERSON.LOCATIONID", rowKey,
    location.getSelected());
    personDataProvider.setValue(
    "DBO.PERSON.BEGINDATE", rowKey,
    newDate.getText());
    //personDataProvider.setValue(
    "DBO.PERSONDEVICE.AQUIREDATE", rowKey,
    newDate.getText());
    personDataProvider.commitChanges();
    info("New User " + newUser.getText() +
    " added to USER table");
    newUser.setText(null);
    } catch (Exception e) {
    log("Cannot add new User ", e);
    error("Cannot add new User: " +
    e.getMessage());
    } else {
    log("Cannot append new User");
    error("Cannot append new User");
    return null;
    }

    Sun's databound components tutorial may prove helpful to you.

  • How to grab the value from a drop down list inside a table cell

    Hello,
    My situation is I have a few columns displayed in a table format using repeater tag. Some cells is a dropdown list(<netui:select /> tag). My question is how can I grab the value when user made a selection.
    I believe I can get the row index but I can't use the datasource attribute to get the user selection since it is in a repeater. All the cell use the same datasource and workshop will give "NULL" value when there are more than one tag bind to the same form valiable.
    Any suggestion are very much appreciated! Thanks a lot in advance.
    My snippet code are:
    <netui-data:repeater dataSource="{pageFlow.ownedTask}"><netui-data:repeaterHeader></netui-data:repeaterHeader>
    <tr valign="top">
    <td><netui:select dataSource="{actionForm.userName}" optionsDataSource="{pageFlow.nameList}" onChange="getUser()" ></netui:select>
    </td>
    <td><netui:select dataSource="{actionForm.empDept}" optionsDataSource="{pageFlow.deptList}" onChange="getSelectedDept()" ></netui:select>
    </td>
    <td><netui:label value="{container.item.status}" />
    </td>
    </tr>
    </netui-data:repeaterItem>
    <netui-data:repeaterFooter></netui-data:repeaterFooter>
    </netui-data:repeater>

    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

  • 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.

  • To pass the selected data to a variable from the drop down list in abap wd

    Hi,
    I have already created a drop down list and populated it with data from table by using the node and linking it with the internal table. Now I need to know which element is selected so based on that I need to perform some function. eg. based on the selected data , i need to populate the next drop down list.
    A demo code will be really helpful.
    Thanks and Regards
    Tenzin

    Hi,
    On selcting the value from the drop down, we have one event ONSELECT.
    Write the code in this event.
    Get the attribute value to lV_xxxxxx using get attribute.
    then using that you can fill the next DDBK attribute.
    method wddoinit .
      data:
            lo_nd_spfli type ref to if_wd_context_node,
            lo_el_spfli type ref to if_wd_context_element,
            ls_spfli type wd_this->element_spfli.
      data:
          lv_carrid LIKE ls_sflight-carrid,
             itab_carrid type wd_this->elements_spfli,
             wa_carrid type wd_this->element_spfli,
             lo_nodeinfo_spfli type ref to if_wd_context_node_info,
             lt_value_set type wdy_key_value_table,
             ls_value_set type wdy_key_value.
      lo_nd_spfli = wd_context->get_child_node( name = wd_this->wdctx_spfli ).
      lo_nodeinfo_spfli = lo_nd_spfli->get_node_info( ).
      select carrid
        from spfli
        into corresponding fields of table itab_carrid.
      if sy-subrc = 0.
        sort itab_carrid by carrid.
        delete adjacent duplicates from itab_carrid comparing carrid.
      endif.
      loop at itab_carrid into wa_carrid.
        ls_value_set-key = wa_carrid-carrid.
        ls_value_set-value = wa_carrid-carrid.
        append ls_value_set to lt_value_set.
      endloop.
      lo_nodeinfo_spfli->set_attribute_value_set( name = 'CARRID'
      value_set = lt_value_set ).
    endmethod.
    in the event of first DDBK, write the select statement wsing where condition of lv_XXX.
    and append the record as above.
    Regards,
    sarath

  • How to populate data from dynamic drop down list to the text field

    Hi,
    I tried to populate data from dynamic drop down list to city field. I would like to concat data from drop down list.When selecting add button to add the item and select item from drop down list, data should be displayed in the text field. However, Please help. I spent alot of time to make it works I am not successful.
    Please see the link below.
    https://acrobat.com/#d=SCPS0eVi6yz13ENV0cnUdw
    Thanks for your help
    Cindy

    Hi Rosalin,
    Loop the hidden table, get the values and populate drop down in each iteration.
    DropDownList1.addItem("Text","Value");
    You can use one more solution for this scenario. If it is a matter of 2,3 dropdowns, put three dropDowns in the form layout and give seperate static data binding to them. At run time make the dropDowns hide/visible as per the requirement.
    Hope this helps.
    Thanks & Regards,
    Sanoosh

  • How do I pass a username form variable from a drop down list/menu to another page?

    Hi,
    I have a login_success.php page that has a drop down list/menu (which lists usernames). I want the user to click on their user name, and when they click the submit button the username information to be passed over to the username.php page which will contain a recordset, sorted by username.
    How do I pass the username info from the drop down list/menu to the username.php page?
    The drop down menu is connected to a recordset listUsername, I have filtered the recordset with the Form Variable = username, and I have used the POST method to send the username to the page username.php. I'm not sure how to structure the php or which page to place it on.
    <form id="form1" name="form1 method="post" action="username.php">
         <label for="username_id">choose username:</label>
         <select name="username_id" id-"username_id">
              <option value="1">username1</option>
              <option value="2">username2</option>
              <option value="3">username3</option>
              <option value="4">username4</option>
         </select>
         <input type="submit" name="send" id="send" value="Submit" />
         <input type="username" type="hidden" id="username" value="<?php echo $row_listUsername['username']; ?>" />
    </form>
    Could somebody help me please?
    Thanks.

    I would not post the variable over, In this case I personally would send it through the URL and use the $_GET method to retreve it. For Example.
    <html>
         <head>
              <title>Test Page</title>
              <script type="text/javascript">
                   function userID(){
                        //var ID = form1.userIDs.selectedIndex;
                        var user = form1.userIDs.options[form1.userIDs.selectedIndex].value;
                        window.location = "test.html?userID=" + user;
              </script>
         </head>
         <body>
              <form id="form1">
                   <select name="userIDs" id="userIDs" onchange="userID();">
                        <option>Select a User</option>
                        <option value="1">User 1</option>
                        <option value="2">User 2</option>
                        <option value="3">User 3</option>
                        <option value="4">User 4</option>
                   </select>
              </form>
         </body>
    </html>
    //PAGE TO RETRIEVE THE USERNAME
    <?php
    if(isset($_GET['userID'])
         $userID = $_GET['userID'];
         echo $userID;
         die;

  • Getting the rawValue of a Drop-Down list on the "change" event

    I am having problems getting the rawValue of a Drop-Down list on the "change" event. It seems that you have to select the same item twice in a row to get the rawValue to be the value of the selected item.
    ::dropdownlist onChange event::
    xfa.host.messageBox(this.rawValue);
    On the first time a value is selected you get 'null'. The second time the same value is selected, you get the selected value.
    Does anyone have any thoughts on why this is happening? Also, I CANNOT use xfa.event.newText, I need to use the rawValue of the dropdownlist.
    Thanks

    The change event occurs before the rawValue is changed. If you NEED to use the rawValue you'll need to use a later event. Perhaps you could use exit so that it gets triggered when the field loses focus?
    Chris
    Adobe Enterprise Developer Support

  • Unable to select IS from the drop down list in message mapping

    Hi,
    i  know that we can monitor 'Integration server' in message monitoring rather than choosing integration engine or adapter engine.
    But in our existing land scapes i am unable to select IS from the drop down list in message mapping.
    using PI 7.1 SP 08.
    please let me know that we need to set up additional configurations settings to select IS form drop down list.
    Regards,
    Pradeep A.

    Hi Pradeep,
    please let me know that we need to set up additional configurations settings to select IS form drop down list.
    There are no extra settings that needs to be done for this. I don't know whether you have noticed this, but IS option will only come up when you want to monitor the messages from the "Database" and not from the "Database overview" or "Archive".
    Regards,
    Neetesh

  • 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

  • How do I select a item from a drop down list on a web in Safari On An. IPad 2.  The list apears and disapears só QuickClips I cannot TAP anything On The list Quickly enough.

    I tried to select an item from a drop down list on a web page in safari and discovered that the list disapeared to quickly for me to make a selection.  Has anyone else found this and solved the problem.  Many thanks.

    Demo wrote:
    I tried it on my iPad and I see what you mean. From what I can see when I go to the site on my Mac, it is Flash based and that will not work anyway.
    Actually, it is Javascript and uses the 'onmouseover' event.

  • Hide Dashboard from the Drop Down list - OBIEE 11.1.1.6.2 BP1

    Hi,
    We have got an Index page, which contains links to all Dashboard the user is allowed to see and it is the home page for every user. Apart from that user's can select Dashboard from the drop down list. Is it possible to hide some of the dashboards from the drop down list but still users should continue accessing them from Index page?
    Thanks in advance.

    Hi,
    For showing the Dashboards as a drop down list I believe you are using HTML code. If so edit the HTML to remove the dashboards you do not want to see in the drop down.
    If the drop down is because of excessive pages shown on the dashboard then under the dashboard properties you can select the hide option for the dashboard. So by default the dashboard page would not show up and the index links would show.
    Let me know if this helped.
    Regards,
    Jay

  • 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)

Maybe you are looking for