Retrieving user selected values in drop down

Hello
I am in trouble again
I am trying to set the user selected values in the dropdown list but whatever i tried i always either get the default values or just the last selceted value or the first selected value
Can anyone help please
heres the code
String values = request.getParameter("selectHeaders" + i++);
    while (values != null)
        selectedValues.add(values);
        values = request.getParameter("selectHeaders" + i++);
[INSIDE HTML]
<%
  for (int j = 0; j < headerList.size(); j++)
         String selectedHeaders = "selectHeaders" + j;
   %>
    <TD><%=headerList.get(j)%></TD>
    <TD><SELECT name="<%=selectedHeaders%>">
     <%
           for (int k = 0; k < sheetHeaders.size(); k++)
                   int m = 0;
                   int val = 0;
                   boolean isSelected = false;
                   if(selectedValues.size() != 0)
                        while((!isSelected) && (m < selectedValues.size()))
                                 String valueStr = selectedValues.get(m).toString();
                                  val = Integer.parseInt(valueStr);
                                 // logger.debug("THE USER SELCTED VALUE : " +val);
                                   // logger.debug("THE LOOP value k: " +k);
                                   if (val == k)
                                        isSelected = true;
                                    else
                                        m++;
                                } //end of while
                                logger.debug("THE BOOLEAN VALUE IS: "+isSelected);
                                %>
//this line is the one where all my confusion is
<OPTION <% if(isSelected) {%> selected <%}%> value = '<%=k%>'><%=sheetHeaders.get(k)%></OPTION>
                        <% } //end of if(isSelectedValues.size())
                        else { %>
                             <OPTION <% if (j == k) { %> selected <%}%> value="<%=k%>" ><%=sheetHeaders.get(k)%></OPTION>
                       <% } //end of else (selectedValues == 0)
                        } //end of for(k)
[END HTML]

I got the solution
Thanx for your time
have a nice day

Similar Messages

  • How to capture selected value from drop down by index

    Dear friends,
    i want to capture the value of select value from drop down by index, for eg if  select air france, how to capture , could any one please let me know
    Thanks
    Vijaya

    Hi Vijaya,
    You can get the value of selected from drop down as below
    Check out the event handler method attached to Onselect event of the ui element drop down by index , if no event is associated, then create an event and attach to the drop down list
    Now you will be having the CONTEXT_ELEMENT in the WDEVENT parameter
                   data lo_element type ref to if_wd_context_element.
                   lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT').
    Now, you can get the static attribute value of selected  drop down value & let us say your drop down list values are populated from context node 'ND_DRP_DOWN'
                   data ls_data type wd_this->element_nd_drp_down.
                             lo_element->get_static_attributes(
                                       importing
                                       static_attributes = ls_data ).
    Hope this helps you.
    Regards,
    Rama

  • Selecting values in drop down list

    Iam trying to create the drop down list. I got some programs, creating these lists for both parameter and ranges on the selection screen using 'VRM_SET_VALUES' . What the user wants is when the selection screen is loaded, he wants to select from the list OR ENTER ANY DATA WHICH IS NOT THERE IN THE LIST. To be able enter any data other than what is there in the list is not working for me.
    plz help its urgent

    Do you want to do it clientside (DHTML/JS/DOM) or serverside (JSP/JSTL)? This is easy to do clientside, but as you're asking this issue in a JSP/JSTL forum ..

  • Passing Selected Values between drop downs

    I am trying to pass values between three different dropdowns.
    For eg:-  Once I select a Category on the "Product Category" Drop down , it should pass the selected Value to the NEXT Drop down, which is "product family" drop down and it should bring all the related product Families, and then the selected product Family should in turn bring all the "Products" belonging to that Family.
    I have tried using the "entry list" for all the dropdowns, the first dropdown works fine as there is no "input" to the "entry list" but the second and third would not work as the selected value is not passed, instead the query returns all the values.
    Any help on this would be appreciated.
    Thanks,
    Naseer

    Hi,
    Yes you can do itin the following way.
    You have DropDown1 ,DropDown2.
    First creat the dropdwon1 using any type of Entry list.
    Now when you are creating the Dropdown2  after the Dataservice selection ,you should assain the @DropDown1 as Input for the Value and Text fields in the output/input section .
    it means when evere you select the value in DroDown1 then that value becomes the input for the data service in the DroDwon2 and it will returns the required output what you had defined in it.
    Thanks,
    Govindu

  • Create a drop down list that populates based on the selection form another drop down list.

    I need to set up a drop down list that is popualated (i.e. displays a certain list of selctions in the drop down list) based on the choise the form user selects in an adjacent List
    For example
    There are two drop down list field sitting side by side in the form
    1. Select State          2. Select Course
    What I want to do is have a list of states in the first drop down list (1.Select State) and depending on which state the form user selects , the second drop down list (2.Select Course) will populate with a selction of courses available in that selected state only (i.e. it will on;y show course available in QLD if QLD is selcted).
    Is this hard to do?

    Hi,
    I would recommend some posts from Stefan Cameron's blog:
    http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/
    http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/
    http://forms.stefcameron.com/2006/12/18/databases-inserting-updating-and-deleting-records/
    http://forms.stefcameron.com/2006/12/07/better-form-design-with-xfa-25/
    Hope that helps,
    Niall

  • Cond display of drop down based on value selected in another drop down form

    Hi,
    I have a requirement in my app in which I need to be able to conditionally display the values in the drop down down list based on the values selected in another drop down list...
    Currently I have 2 drop downs.
    First drop down is a list of Jacks from 2000 to 4999...
    Second Drop down consists Chassis ranging from 1 to 900..
    So when a user selects any jack between 2000 - 2999, in the second drop down only Chassis ranging from 1 to 300 should appear.
    when anything between 3000 - 3999 is selected, Chassis ranging from 301 to 600 should appear..
    and for jacks between 4000 - 4999, Chassis ranging from 601 to 900 should appear in the second drop down.
    Can someone please provide me pointers on how to do this..
    Thanks,
    Nehal

    Hi Larry,
    Thanks for your response..
    Here are the queries for my select lists.
    P62_JACK
    select list query for Jacks:
    select JACK_NUM display_value, JACK_NUM return_value
    from CTS_LIST_OF_JACKS
    order by 1
    P62_CHASSIS_BLADE_PORT
    select NETWORKPORT display_value, NETWORKPORT return_value
    from CTS_LIST_OF_NETWORKPORTS
    order by NETWORKPORT_ID
    jacks range from 2000 to 4000
    chassis_blade_port ranges from 100 to 900...
    Can you please let me know how to do it..
    Thanks,
    Nehal

  • Value need to select from the drop down list & should be save under Variant

    Hi,
    My requirement is that i need to display two values in drop down list of a selection screen. Between two values , one value will be display as a default value. During program execution user can choose any value from drop down list as per requirement and
    he can save this in a Variant.
    Next time if he choose data from Variant, but still he will be able to select any value from drop down list.
    For that i am using FM VRM_SET_VALUES. How can i make the changes to meet my requirement using this function module or any other suggestions will be highly appreciated.
    Thanks & Regards,
    Tutun
    Edited by: tutun nandy on Nov 19, 2010 12:21 PM

    Try to disable hardware acceleration in Firefox.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    *https://hacks.mozilla.org/2010/09/hardware-acceleration/
    *https://support.mozilla.org/kb/how-do-i-upgrade-my-graphics-drivers
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How to capture the value selected in the drop down box

    Hi all,
    I am populating values in  drop down box by using FM vrm_set_values in module pool.
    like below
    01  ABC
    02 ACB
    03 BCA
    04 CAB
    in module pool drop down box element name is RQGM-VALUE.
    Problem is what ever the value is select in the drop down box from above element RQGM-VALUE is not filling any value.
    i need to capture the value selected in the drop down box and pass it to another variable.

    Hi,
    Refer this standard code. Your issue will be resolve.
    REPORT demo_dynpro_dropdown_listbox.
    TYPE-POOLS vrm.
    DATA: name  TYPE vrm_id,
          list  TYPE vrm_values,
          value LIKE LINE OF list.
    DATA: wa_spfli TYPE spfli,
          ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    TABLES demof4help.
    name = 'DEMOF4HELP-CONNID'.
    CALL SCREEN 100.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE init_listbox OUTPUT.
      CLEAR demof4help-connid.
      SELECT  connid cityfrom cityto deptime
        FROM  spfli
        INTO  CORRESPONDING FIELDS OF wa_spfli
       WHERE  carrid = demof4help-carrier2.
        value-key  = wa_spfli-connid.
        WRITE wa_spfli-deptime TO value-text USING EDIT MASK '__:__:__'.
        CONCATENATE value-text
                    wa_spfli-cityfrom
                    wa_spfli-cityto
                    INTO value-text SEPARATED BY space.
        APPEND value TO list.
      ENDSELECT.
      CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                id     = name
                values = list.
    ENDMODULE.
    MODULE user_command_100.
      save_ok = ok_code.
      CLEAR ok_code.
      IF save_ok = 'CARRIER' AND NOT demof4help-carrier2 IS INITIAL.
        LEAVE TO SCREEN 200.
      ELSE.
        SET SCREEN 100.
      ENDIF.
    ENDMODULE.
    MODULE user_command_200.
      save_ok = ok_code.
      CLEAR ok_code.
      IF save_ok = 'SELECTED'.
        MESSAGE i888(sabapdocu) WITH text-001 demof4help-carrier2
                                            demof4help-connid.
      ENDIF.
    ENDMODULE.

  • How to get the values of drop downs, which are gonna create at run time.

    As per my design requirement, I have to create drop downs in an ADF display table.
    The no# of rows of the table are gonna decide the no# of the drop downs. User can select the values from drop downs. My issue is, how can I capture the selected values of those drop downs as those are gonna created run time.

    Hi
    ohh ,ok ,then as u said that u r storing twenty values ,thats y i aksed earlier ,are these form values part of tbale ,or as u said 20 values are there ,for these u r creating 20 form values ???.
    My suggestion would be ,u do four calculation and put all your results in a hashmap ,and keep this hash map in to sesion ,using the following method
    pageContext.putTransactionTransientValue("HashMapName",myHashMap);
    and inside the PFR method when u want to display these values ,u can loop through your hashmap and can display these values.
    like this
    HasMap hm=pageContext.getTransactionTransientValue("HashMapName");
    thanx
    Pratap

  • Extracting values from drop down buttons html forms

    Hello,
    I would like to know how to obtain the values which is selected through the drop down box. Iam using Java Script as a client side scripting lang..
    Here is my code so far..do let me know what to do further. Iam not getting the alert mesg which is sitting in the put() so let me know how the put method should work
    Thanks a lot
    avis
    <HTML>
    <HEAD>
    <script language="javascript" type="text/javascript">
    <!-- hide
    function put()
    choice = document.forms.Pri.list.optionsdocument.forms.Pri.list.selectedIndex]
    if (choice ="0")
    alert("enter state"+choice);
    function goto()
    Pri.list.options.value=" "
    //end -->
    </script>
    </HEAD>
    <BODY>
    <form name="Pri" method = "get" action="">
    State<SELECT NAME="list" onChange="put()">
              <OPTION>
    <OPTION>Alabama
    <OPTION>California
              </SELECT>
    <input type="submit" Value="Submit">
    <input type=button name="Reset" value=Reset onClick=goto()>
    </form>
    </BODY>
    </HTML>

    I'm not sure what you're talking about... if you don't select an option from the list, the onchange function isn't going to be called, so of course the the alert isn't working.
    You sound like you are complaining that when the form submits, the value for the select list is the first option (""). I fail to see why this is a problem. If the value is "", then you handle it like nothing was selected. In a single select list like that, an option is always selected. The whole point of having a blank option is to allow the user to pick it. Otherwise don't put a blank option.
    In general, you don't need to use a button to do reset, you use a reset button: input type="reset". And it'll reset on it's own.

  • Changing Values of Drop Down Box??

    I have created a form that has 100 drop down boxes, each drop down box has the same values for the user to choose. I would like to know if it is possible to remove the selected value from the remaining drop downs once it has been selected?
    Example:
    Drop Down Box 1: user selects "A" when the user moves to Drop Down Box 2 "A" is not available for selection but the remaining values are. User Selects "B", moves to Drop Down 3 and both "A and B" are not available for selection.
    I hope this makes sense and can't figure out how to make this happen, I am a fairly new user to LC and would appreciate any help. Thank you for your time!!

    Hi,
    While technically you can do this, I think that it would be a poor performance because the script would need to loop through the 100 dropdowns.
    You would need to place script in the preOpen event of the dropdowns, that loops through and looks at previous selections.
    I worked this up over the weekend, but it is not 100%. http://assure.ly/KXAUg5.
    The script in the preOpen event calls a function in the AssureDynamics script object (see the Hierarchy).
    Hopefully someone can pick up the running on this, as I wont be able to for the week.
    Good luck,
    Niall

  • How to set default value for drop down box in jsf

    Hi,
    Can anyone help me to set the default value in drop down box using <af:selectManyChoice> ?
    As I know there is an unselectedLabel attribute in <af:selectOneChoice> but not valid attribute for <af:selectManyChoice>.
    Any help must be appreciated.
    Regards,
    AK

    Hi Frank
    My entity type is a List in managed bean. I have set the entityType in the constructor of the managed bean. I have attached my code here.
    TPSearchCriteriaBean.java****************************************
    /** Constructor */
    public TPSearchCriteriaBean() {
    super();
    entityType=new ArrayList<String>();
    entityType.add(UIConstants.LIST_ITEM_ALL);
    authorizationType=new ArrayList<String>();
    authorizationType.add(UIConstants.LIST_ITEM_ALL);
    companyType=new ArrayList<String>();
    companyType.add(UIConstants.LIST_ITEM_ALL);
    mrgStatus=new ArrayList<String>();
    mrgStatus.add(UIConstants.LIST_ITEM_ALL);
    legalStatus=new ArrayList<String>();
    setEntityType(entityType);
    setAuthorizationType(authorizationType);
    setCompanyType(companyType);
    setMrgStatus(mrgStatus);
    country = "0";
    //address = new AddressBean();
    UIConstants.java***********************************************************
    public static final String LIST_ITEM_DEFAULT = "select";
    public static final String LIST_ITEM_ALL = "0";
    LOVManager.java*****************************************************************
    public List<SelectItem> getLovList(String lovType, boolean requiredOption_SELECT, boolean requiredOption_ALL)
    log.debug("LOV loading for " + lovType + ": START");
    List<SelectItem> lovList = new ArrayList<SelectItem>();
    //check validity of lov loading request
    validLov:
    for (int i = 0; i < lovTypeArray.length; i++)
    if (lovTypeArray.equals(lovType))
    break validLov;
    log.debug("ERROR: LOV Type not valid.");
    return lovList;
    //First select is replaced by ALL here
    //<-- Select --> should be an option
    if (requiredOption_SELECT)
    lovList.add(new SelectItem(UIConstants.LIST_ITEM_DEFAULT, "--Select--"));
    LOVDao dao = new LOVDao();
    dao.loadLOVValues(lovType, lovList);
    log.debug("LOV Loading successful!");
    //<ALL> should be an option
    if (requiredOption_ALL)
    lovList.add(new SelectItem( UIConstants.LIST_ITEM_ALL, "ALL"));
    return lovList;
    Kindly help me.
    Regards,
    AK

  • Preselected values in drop-down lists

    Hi everyone,
    Some quick background before stating the issue: I've
    developed a set of forms in ASP.NET working with a SQL Server 2000
    db where my client can add, edit, and search records within their
    intranet. When adding a record, they are making some selections
    from a drop-down list where the values are dynamically populated
    from a lookup table. There are three sections to the form and each
    section gets its values from a different table. When editing a
    record, the drop-down lists should show all the choices but
    prepopulate the list with their earlier selection.
    Here's the issue: everything is working just fine on my box
    and is working 90% on my client's server. The problem is that when
    editing a record, two of the three sections of the form are showing
    the correct values. The third section is showing the first choice
    in the drop-down list rather than what was recorded in the db.
    Again, this is not happening in my development environment.
    It's only happening on my client's environment. I've triple-checked
    the code and confirmed that the datatypes in their tables match
    what I've got set up in my db. The fact that these pages are behind
    my client's firewall make the usual trial and error kind of
    troubleshooting very difficult.
    This is very mysterious. Any suggestions for what I can check
    and how I can troubleshoot this?
    Thanks.

    In case anyone else comes across this problem, it seems that
    deleting and recreating the table solved the problem. I renamed the
    original table and compared it to the one I recreated and they
    appear to be identical but nevertheless that was the
    solution.

  • Dashboard prompt issue  (Restricting Values in drop down) ????

    Hi Friends,
    In my report I have "days to start" column which list almost 10,000 values ranging from -1000 to 5000.
    I need to create a prompt for this report on "Days to Start" column.
    When I create a prompt on Days to start with Operator "Greater than" and Control "Drop Down List" it shows me all the values in Drop down.
    I need only specific Values like 30, 60, 90, 180 which might not be in the "days to start" column.
    If I select "SQL Result" what should be the SQL for that??
    Is there any other way to solve this problem
    Aprreciate your help on this
    Thanks

    You could make a table VALUES with 1 column and fill it with values like 30,60,90....then in sql you'd write SELECT * FROM VALUES....as simple as that
    (of course, it'd have to be in RPD, and you'd need to expose it in Presentation layer)
    Edited by: wildmight on Feb 19, 2009 8:18 AM
    Also, you could try this - it works for me - but it could be slower and you might want to figure out how to round it - also, it has to be a number or cast to number format
    SELECT Table."Column"/30 saw_0 FROM "Subj Area" ORDER BY saw_0
    Edited by: wildmight on Feb 19, 2009 8:29 AM

  • Not able to set values in drop down for a table field

    Hi All,
    I am not able to set values in drop down for a table field. Although I am able to set these values to a stand alone field but its not happening for a particular table field. I am using ABAP web dynpro for coding.
    Pls help.
    Regards,
    Bhaskar

    Hi Otto,
    Here is the code I am using:
    * navigate from <CONTEXT> to <DATASOURCE> via lead selection
      lo_nd_datasource = wd_context->get_child_node( name = wd_this->wdctx_datasource ).
    * navigate from <DATASOURCE> to <CHANGING_PARAM> via lead selection
      lo_nd_changing_param = lo_nd_datasource->get_child_node( name = wd_this->wdctx_changing_param ).
    * navigate from <CHANGING_PARAM> to <EDUCATION_TAB> via lead selection
      lo_nd_education_tab = lo_nd_changing_param->get_child_node( name = wd_this->wdctx_education_tab ).
      node_info = lo_nd_education_tab->get_node_info( ).
      REFRESH ddlb_value_set.
      DATA: wa_edu_est TYPE t517t.
      SELECT * FROM t517t INTO wa_edu_est WHERE sprsL = 'EN'.
        s_element-text = wa_edu_est-stext.
        s_element-value = wa_edu_est-slart.
        APPEND s_element TO ddlb_value_set.
      ENDSELECT.
      SORT ddlb_value_set BY text.
    *    Set Value_sets to node_info
      node_info->set_attribute_value_set(
         name      = 'EDU_EST'
         value_set = ddlb_value_set ).
    Regards,
    Bhaskar

Maybe you are looking for

  • How to print pdf file to my Designjet 500+HPGL2 (C7769B)

    Hi, We have HP Designjet 500+GL2 plotter in the office, used to print A1 & A3 drawings. Last time someone from HP install HP eprint & share to my computer for me to print PDF files to the plotter. But my CPU brokedown, so now I'm using a new PC. But

  • Set Scope for Virtual Machine in 2012 R2 WMI v2 Namespace

    Basically, I want to know how to set the scope for a hyper-v vm in Server 2012 R2 so users see only the specific vm's assigned to them. I work at an academic institution, we intend to upgrade our 2008 R2 servers to 2012 R2 but before we can do that w

  • Non-english text cannot be displayed correctly

    I'm trying to create a report file in pdf format, but display of non-English text isn't correct, (utf-8 encoding) Ð<92>ойна в Южной Ð<9e>Ñ<81>еÑ<82>ии BT /F1 1 Tf 14 0 0 14 50.00 631.00 Tm 0.00 0.00 0.00 rg (Ð<92>ойна в Южной Ð

  • Please Help about Aino, My sms's have gone

    HI I removed out my memory card from Aino and reseted it. But when i inserted memory card in it again ,all SMS's had gone!!!!  i dont know they are deleted or disapeared?! Please guide me that How i can recovery them and why that happened? Thanks

  • Upgrade after 2 years

    Hi all, I just managed to do a complete upgrade (pacman -Syu) of Arch on my old laptop (which I seldom use). It went pretty smoothly, given that the last such upgrade was about 26 months ago! There were some problems, of course, and I had to use the