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

Similar Messages

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

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

  • 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

  • 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

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

  • Populating drop down list in a table cell-urgent

    Hi all
    I have a problem. I want to populate a dropdown list in a table cell. can anybody tell me the step by step procedure for that.
    I am doing it generally. not using R/3
    I am creating sub node like u have mentioned. I haven't done it using wizard.
    Is there any difference in the way we populate this list?
    My root node is expense. Inside that some value attributes are there. For the drop down list i've created a sub node 'extype'.
    I am getting error.
    it is:
    com.sap.tc.webdynpro.progmodel.context.ContextException: Node(EREmpHomeView.expense.extype): cannot bind or add elements because the node has no valid parent
    Following is the code i've written.
    IPrivateEREmpHomeView.IExtypeElement el;
              IPrivateEREmpHomeView.IExtypeNode nd=wdContext.nodeExpense().nodeExtype();
              el=wdContext.nodeExpense().nodeExtype().createExtypeElement();
              el.setEtype("Travel");
              nd.addElement(el);
    Sill i'm getting the same error
    Hi Nidhideep
    Error has gone with the code that Mr Anil has given. But there is no value in the List. Dropdown list is coming as a blank list.
    Thanks and Regards
    Aparnna
    Message was edited by:
            aparnna prasad

    hi
    Aparna try this code:
    1. Context description at design time:
    Value-Node "myNode", collection type=list, cardinality=0..n, selection=0..n
    and the attribute:
    Value attributes “myValue”, type="String".
    2. The corresponding Java source code example that you create in the wdDoInit method of the controller implementation:
    // The ISimpleTypeModifiable interface enables access to
    //a data type instance that can be modified at runtime:
    ISimpleTypeModifiable myType =
       wdThis.wdGetAPI().getContext.getModifiableTypeOf(“.myNode.myValue”);
    //Sets the label text for this data type.
    myType.setFieldLabel(“New label”)
    //Sets the valid values of this data type. The individual elements are inserted
    //when the put method is called and
    //and the value set is filled with the appropriate
    //key value pair.
    IModifiableSimpleValueSet values =
       getSVService().myType.getModifiableValueSet();
    values.put(“key_1”,”Mister”);
    values.put(“key_2”,”Mistress”);
    values.put(“key_3”,”Miss”);
    Regards
    Nidhideep

  • How to get the values from fileds

    Dear All,
    Good Afternoon,
    I want to set the 0 value to the fields at the time of page loading.
    For this,
    i tried the following ways
    pageContext.putParameter("fieldid",0);
    and
    OAMessageTextInputBean bean1=(OAMessageTextInputBean) webBean.findChildRecurssive("fieldid");
    bean1.setValue(pageContext,0)
    for getting the values i used
    String id=pageContext.getParameter("fieldid");
    but i returns null values only while it has 0 value.
    how can get the 0 value from that field

    Hi,
    In order to set values you should use:
    OAMessageTextInputBean bean1=(OAMessageTextInputBean) webBean.findChildRecurssive("fieldid");
    if(bean1!=null)
    bean1.setText("0");
    and in order to grab the values from the fields
    String id=(String)pageContext.getParameter("fieldid");
    Thanks,
    Gaurav

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

  • How to get the value from databank

    Hi,
    How to get the value from databank? and how to set the same value to visual script object?
    thanks,
    ra

    Hi,
    You can use GetDatabankValue(HeaderName, Value) to get the value from databank and SetDataBankValue(HeaderName, Value) to set the value to databank.
    You can refer to the API Reference to see list of associated functions and techniques we can use with related to Data Bank.
    This is the for OFT but if you are using Open Script then you have direct access for getting the databank value but when it comes to setting a value you have to use File operation and write you own methods to do the set operation.
    Thanks
    Edited by: Openscript User 100 on Nov 13, 2009 7:01 AM

  • How to get the values from html:select? tag..?

    i tried with this, but its not working...
    <html:select styleClass="text" name="querydefs" property="shortcut"
                 onchange="retrieveOptions()" styleId="firstBox" indexed="true">
    <html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
    </html:select>
                        <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>

    <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>This java script is not working at all..its not printing anything in document.write();
    This is code..
    <td class="rowcolor1" width="20%">
    <html:select styleClass="text" name="querydefs" property="shortcut"
                             onchange="retrieveSecondOptions()" styleId="firstBox"
                             indexed="true">
                             <html:options collection="advanced.choices" property="shortcut"
                                  labelProperty="label"  />
                        </html:select>i tried with this also. but no use..i'm not the getting the seleced option...
    function retrieveOptions(){
    firstBox = document.getElementById('firstBox');
                             if(firstBox.selectedIndex==0){
          return;
        selectedOption = firstBox.options[firstBox.selectedIndex].value;
    }actually , how to get the values from <html:select> ...?
    my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window

  • How to get the values from repeated frame?.

    Hi
    how to get the values from repeated frame?. i have to disply the first 3 digits in another place in my report.
    i have field empno in repeated frame and i want to disply first 3 digits in another place in the same report.
    thanks

    How often do you need to display it? It sounds like you might want to base a summary on that formula with a function of first or last. If it's a per page basis, it can be a page level summary. If it's at a higher level repeating frame, then you can create the summary at that level. I'd suggest taking a look at the online help for summaries using the first/last functions.
    Hope that helps,
    Toby

Maybe you are looking for

  • DMS configuration & customization

    Hi SAP Gurus,                I am in realization phase of SAP DMS&ECM. So Pls. tell me from where i can get the detailed screen shots for the whole customization. Please Help... Thank email id:[email protected]

  • JavaScript: calling Java system code message...

    When I try and call an applet function from Javascript, I get the following message in the output window: JavaScript: calling Java system code JavaScript: default security policy = file:// ... and the method isn't called. Can someone tell me what I n

  • Send Unix command won't work under 10.2.8

    So I am running this command in a lab of 10.2.8 machines. I go to send Unix Command then I put this in: Send Unix Command user: root osascript -e 'tell application "System Events" to keystroke "map"'; \ osascript -e 'tell application "System Events"

  • Information in replacement proceesing type

    hi 2 all, i am very new to BW i got an oppurtunity to work on reporting that to on varibles so can body tell me why we should replacement pat? in what we can use this one? your suggetions has a great value.

  • Php process too slow; can I increase timeout?

    I am working on a php program to preprocess images. I want to handle landscape and portrait format images differently, and have written a test program to copy the original files to two different directories according to their format. The program is w