How can I pass a value that is selected in a dropDownlist into a java metho

My explanation is below and heres my jsp and javascript code:
<form action="" method="post" enctype="multipart/form-data" name="form1">
<table width="90%" cellpadding="0" cellspacing="0" class="tblProperties">
<tr class="trBackColor"><td class="tdLayoutTwo"> </td></tr>
<tr class="trLayout">
<td class="tdLayout" align="right">Student Name: </td>
<td width="316">
<select name="studentID" id="studentID">
     <option value="0" selected>Select...</option>
     <%=frmStudent.createList(appStudent.getStudentID())%>
    </select>
</td>
</tr>
<input class="inputForm" type="submit" onClick="setValues(form1)" name="Submit"  value="Continue">               
</td>
</tr>
</table>
</form>Javascript code...
function setValues(frm) {
     var stuID = frm.studentID.value;
     <%=appForm.setStudentID(stuID)%>
     }I need to pass a selected value from the Form Dropdown into a java setMethod() in my jsp page. But I can't seem to figure out how? I used the "setValue" javascript funtion as shown above, that passes the value from Javascript to jsp on a onClick event, but it doesn't work. I did some research on the internet and have learnt that I cannot pass values from Javascript to jsp.
Is there any other method, may be after I hit the submit button? I need to pass the selected value from a student dropdown list to a jsp setMethod(). So for example if I select, Jon from a Dropdown list which has a ID = 5, then I need to pass 5 to the java method.
Any Clues?
Thanks

hi zub786,
you have to do following things:
1) Get the value of the selected index using javascript methods on selection of student ID.
2) Use hidden tag and pass that index to value of the hidden parameter.
3) Use that parameter in your next Jsp where you want that id.
I hope this info might help u.
Leozeo

Similar Messages

  • How can I pass a value into a page fragment?

    How can I pass a value into a page fragment?
    I am implementing four search screens. And the only thing different about them will be their backing bean.
    So I’d like to do something like have four pages, each which retrieves its appropriate backing bean, sets that bean to a variable, and then includes a page fragment which contains the generic search page code (which will make use of that variable).
    The code in the four pages would be something like this:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:c="http://java.sun.com/jsp/jstl/core">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <c:set var="searchPageBackingBean"
    value="#{pageFlowScope.employeeSearchPageBean}"
    scope="page"/>
    <jsp:include page="./SearchPageBody.jsff"/>
    </jsp:root>
    At this point, what I’m seeing is that the fragment page, SearchPageBody.jsff, has no visibility of the searchPageBackingBean variable, either referencing it as #{pageFlowScope.searchPageBackingBean} or just #{searchPageBackingBean}

    The following will work, assuming you are needing to access a managed bean:
    Put this in the parent page:
    <c:set var="nameOfSearchPageBackingBean"
    value="employeeSearchPageBean"
    scope="request"/>
    Put this in the child, SearchPageBody.jsff:
    <c:set var="searchPageBean"
    value="#{pageFlowScope[nameOfSearchPageBackingBean]}"
    scope="page"/>

  • How can I pass the value to another frame?

    Hi all,
    The following is part of my coding of a frame. Once i click on the jButton2, the selected value will be stored into a variable named NAME and the value will be displayed by a label in same frame. At the same time, a new frame named TESTING3 will be set to visible.
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
    // TODO add your handling code here:
        String name = (String)jList1.getSelectedValue();
        jLabel1.setText(name);       //display the value in a label in same frame
        new testing3().setVisible(true);     //a new frame set to visible
    }      Question: How can I pass the value to TESTING3 frame and display it on that frame?
    Thanks,
    ning.

    just make an archive that save that variable and them get them from de clase were you save it
    public class sav {
    String n;
    public sav {
    n="";
    public void addn(String x){
    n=x;
    public String shown(){
    return n;
    and them save it from the frame
    sav sun = new sav();
    sav.addn(f);
    them call it from the other frame
    sav sin = new sav();
    String s = sin.shown();
    label.setText(s);
    and i think thats you want to do if its not please explain me better
    bye

  • How can i pass the value one from to another form?

    hi all
    how can i pass the value one from to another form  with out use it when ever i want to needed this value that ican useit?
    like i have two fields U_test1 and U_test2  table name @AUSR
    that i have  four form  A! , A2,A3,A4    please tell me in details....?

    Hi,
    U can assign the values to some variables and access then in ur required forms.
    Vasu Natari.

  • How can i pass calculated value to internal table

    Hi
    i have to pass calculated value into internal table
    below field are coming from database view and i' m passing view data into iznew1
    fields of iznew1
                 LIFNR  LIKE EKKO-LIFNR,
                 EBELN  LIKE EKKO-EBELN,
                 VGABE  LIKE EKBE-VGABE,
                 EBELP  LIKE EKBE-EBELP,
                 BELNR  LIKE EKBE-BELNR,
                 MATNR  LIKE EKPO-MATNR,
                 TXZ01  LIKE EKPO-TXZ01,
            PS_PSP_PNR  LIKE EKKN-PS_PSP_PNR,
                 KOSTL  LIKE EKKN-KOSTL,
                 NAME1  LIKE LFA1-NAME1,
                 NAME2  LIKE LFA1-NAME2,
                 WERKS  LIKE EKPO-WERKS,
                 NETWR  LIKE EKPO-NETWR,
                 KNUMV  LIKE EKKO-KNUMV,
                 GJAHR  LIKE EKBE-GJAHR,
    and now i want to pass
    one field ED1  which i has calculated separatly and i want to pass this value into iznew1
    but error is coming that iznew1 is a table with out header line  has no component like ED1.
    so how can i pass calculated value to internal table iznew1,

    When you declare your internal table , make an addtion occurs 0
    eg . data : begin of iznew occurs 0 ,
                    fields ...
       add the field here ed1.
               end of iznew.
    now when you are calculating the value of ed1,
    you can pass the corresponding value of  ed1 and modify table iznew.
    eg
    loop at iznew.
    iznew-ed1 = ed1.
    modify iznew.
    endloop.

  • How can I pass a value to the command prompt?

    I was wondering how can I pass a value to the command prompt with Windows and Linux? I'm more interested in Linux's system than Windows though. Is there a way to return info from the command prompt?

    Here is a snippet from http://mindprod.com/jglossexec.html that explains how in detail.
    Runtime.getRuntime().exec("myprog.exe") will spawn an external process that runs in parallel with the Java execution. In Windows 95/98/ME/NT/2000/XP, you must use an explicit *.exe or *.com extension on the parameter. It is also best to fully qualify those names so that the system executable search path is irrelevant, and so you don't pick up some stray program off the path with the same name.
    To run a *.BAT, *.CMD, *.html *.BTM or URL you must invoke the command processor with these as a parameter. These extensions are not first class executables in Windows. They are input data for the command processor. You must also invoke the command processor when you want to use the < > | piping options, Here's how, presuming you are not interested in looking at the output:
    Runtime.getRuntime( ).exec ("command.com /E:1900 /C MyBat.bat" );
    Runtime.getRuntime( ).exec ("cmd.exe /E:1900 /C MyCmd.cmd" );
    Runtime.getRuntime( ).exec ("C:\\4DOS601\\4DOS.COM /E:1900 /C MyBtm.btm" );
    Runtime.getRuntime( ).exec ("D:\\4NT301\\4NT.EXE /E:1900 /C MyBtm.btm" );
    There are also overloaded forms of exec(),
    Runtime.getRuntime( ).exec ("command.com /E:1900 /C MyBat.bat", null);
    Runtime.getRuntime( ).exec ("command.com /E:1900 /C MyBat.bat", null, "C:\\SomeDirectory");
    The second argument can be a String [], and can be used to set environment variables. In the second case, "C:\\SomeDirectory" specifies a directory for the process to start in. If, for instance, your process saves files to disk, then this form allows you to specify which directory they will be saved in.
    Windows and NT will let you feed a URL string to the command processor and it will find a browser, launch the browser, and render the page, e.g.
    Runtime.getRuntime( ).exec ("command.com http://mindprod.com/projects.html" );
    Another lower level approach that does not require extension associations to be quite as well set up is:
    Runtime.getRuntime( ).exec ("rundll32 url.dll,FileProtocolHandler http://mindprod.com/projects.html" );
    Note that a URL is not the same thing as a file name. You can point your browser at a local file with something like this: file://localhost/E:/mindprod/jgloss.html or file:///E|/mindprod/jgloss.html.
    Composing just the right platform-specific command to launch browser and feed it a URL to display can be frustrating. You can use the BrowserLauncher package to do that for you.
    Note that
    rundll32.exe url.dll,FileProtocolHandler file:///E|/mindprod/jgloss.html
    won't work on the command line because | is reserved as the piping operator, though it will work as an exec parameter passed directly to the rundll32.exe executable.
    With explicit extensions and appropriately set up associations in Windows 95/98/ME/NT/2000/XP you can often bypass the command processor and invoke the file directly, even *.bat.
    Similarly, for Unix/Linux you must spawn the program that can process the script, e.g. bash. However, you can run scripts directly with exec if you do two things:
    Start the script with #!bash or whatever the interpreter's name is.
    Mark the script file itself with the executable attribute.
    Alternatively start the script interpreter, e.g.
    Runtime.getRuntime( ).exec (new String[]{"/bin/sh", "-c", "echo $SHELL"}";

  • How can I pass field value betwen view in ICWC?

    Hi experts,
    I am new to this BSP programming. I have some requirements to modify standard ICWC in CRM 5.0
    Hope can get some advices and helps here.
    I have added a new field called <status> to context note SEARCHCUSTOMER in BupaSearchB2B view and also the same field name to context note CUSTOMER in BupaCreate view.
    I have added the field into both the HTM views and able to execute thru WebClient. However, I have one problem in passing the <status> value from BupaSearchB2B view  to the BupaCreate view when I click on the 'create' button.
    I do search and saw this thread How can I pass field value beetwen view in IC Web Client? , but i cant figure out how it works.
    Do I need to create the field <status> to context note CUSTOMER in BupaSearchB2B? Currently the context note does not have any attributes.
    Really appreciate for any help.
    Edited by: mervyn tay on Apr 7, 2009 11:42 AM

    solved by myself...
    code in the CREATE_ACCOUNT method.
            ev_entity->set_property( iv_attr_name = 'ZZICNO'
                                     iv_value = lv_icnum1 ).

  • In Drop Down by Index how can i pass default value Dynamically

    Hi Friends,
    In Drop Down by Index how can i pass default value Dynamically.Please help me.
    Thanks in advance.
    Regards,
    Kumar.

    hi,
    if you want the value to be defaulted only the first time you execute the program then write the code which suman has mentioned in the views method
    wddoinit.
    Regards
    Sajid

  • How can I receive the value of a selected item in the backing bean

    I have a table in a jspx file.
    When I go to the detail page I want to do something with the value of the currentrow.
    I want do a calculaction of the value of ClbId.
    How can I receive the value of the selected ClbId in my backing bean
    <af:table value="#{bindings.Searchteamlist.collectionModel}"
    var="row" rows="#{bindings.Searchteamlist.rangeSize}"
    first="#{bindings.Searchteamlist.rangeStart}"
    emptyText="#{bindings.Searchteamlist.viewable ? 'No rows yet.' : 'Access Denied.'}"
    selectionState="#{bindings.Searchteamlist.collectionModel.selectedRow}"
    selectionListener="#{bindings.Searchteamlist.collectionModel.makeCurrent}"
    rendered="#{backing_FirstFlag_Club_Club.searchFirstTimeClub_Club_AdresAndereClubs == false}">
    <af:column sortProperty="Matricule" sortable="true"
    headerText="#{bindings.Searchteamlist.labels.Matricule}">
    <af:outputText value="#{row.Matricule}"/>
    </af:column>
    <af:column sortProperty="ClbId" sortable="true"
    headerText="#{bindings.Searchteamlist.labels.ClbId}">
    <af:outputText value="#{row.ClbId}">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.Searchteamlist.formats.ClbId}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="Nom" sortable="true"
    headerText="#{bindings.Searchteamlist.labels.Nom}">
    <af:outputText value="#{row.Nom}"/>
    </af:column>
    <f:facet name="selection">
    <af:tableSelectOne text="Select and">
    <af:commandButton text="Submit"
    action="club_AdresAndereClubsDetail">
    <af:setActionListener from="#{row}"
    to="#{processScope.row}"/>
    </af:commandButton>
    </af:tableSelectOne>
    </f:facet>
    </af:table>

    hi tde
    Using an Expression Language helper class like this one from Steve Muench ...
    http://radio.weblogs.com/0118231/stories/2006/12/18/sourceForMyFavoriteElHelperClass.html
    ... you could write something like this in your backing bean:
    Integer vClbId = (Integer)EL.get("#{row.ClbId}");(Make sure to cast it to the correct type.)
    success
    Jan Vervecken

  • How can I turn a form that is open on my browser into a PDF doc if I cannot save it onto my computer

    How can I turn a form that is on my Safari browser into a PDF if I cannot save the form onto my computer?

    Acrobat XI Pro has a "create PDF from a web page" feature. If you have Acrobat XI Pro installed perhaps you can "capture" the web form as a PDF. If so then this PDF can (of course) be saved to the local machine's HDD.
    Be well...

  • How can I pass empty value in URL Parameter

    Hi,
    I am passing different URL parameters to one page, to filter
    the recordset on that page. How can I pass an empty value in the
    URL parameter so that the recordset in unfiltered?
    The URL parameter is based on one field of the database:
    ContentType. So, the link would be to
    default.asp?ContentType=Event
    and then all records that have the ContentType field in the
    DB as Event are displayed. Is it possible to use this system to
    pass an empty parameter so that all records are displayed?
    Thanks
    Ian

    ?ContentType=All
    <% if (ContentType == "All")
    Build recordset w/o filtering
    ASP is rusty, but those are the basics.
    "iandobie" <[email protected]> wrote in
    message
    news:e8im80$q7m$[email protected]..
    > Hi,
    > I am passing different URL parameters to one page, to
    filter the recordset
    > on
    > that page. How can I pass an empty value in the URL
    parameter so that the
    > recordset in unfiltered?
    > The URL parameter is based on one field of the database:
    ContentType. So,
    > the
    > link would be to
    > default.asp?ContentType=Event
    > and then all records that have the ContentType field in
    the DB as Event
    > are
    > displayed. Is it possible to use this system to pass an
    empty parameter so
    > that
    > all records are displayed?
    > Thanks
    > Ian
    >

  • How can I pass dynamic value as a user input parameter in discoverer?

    Hi,
    I have a requirement for a discoverer report like this: The report will display only details for Suppliers that have expired (or soon to be) Insurance details. That is the Expiration Date is less than or equal to the day the report is being run plus any days specified in the Number of Days in the Future Parameter.
    The sample code as:
    SELECT s.segment1 vendor_number
    ,s.vendor_name
    ,flv1.meaning classification
    ,pca.certificate_number
    ,pca.certifying_agency
    ,pca.expiration_date
    ,flv2.meaning status
    FROM ap_suppliers s
    ,pos_bus_class_attr pca
    ,fnd_lookup_values flv1
    ,fnd_lookup_values flv2
    WHERE pca.vendor_id = s.vendor_id
    AND flv1.lookup_code = pca.lookup_code
    AND flv1.lookup_type = pca.lookup_type
    AND flv2.lookup_code = pca.class_status
    AND flv2.lookup_type = 'POS_BUS_CLASS_STATUSES'
    AND pca.expiration_date <= trunc(sysdate) + <No. of Days in the Future>
    order by pca.expiration_date asc
    Now the parameter is Number of Days in the Future (Enter the number days in the future to extract the data. This will default to 0).
    Is it possible in discoverer to do so as in query i do that like a condition as pca.expiration_date <= trunc(sysdate) + <No. of Days in the Future>.
    How can I pass <No. of Days in the Future> as a user input parameter in discoverer?
    Please help.

    Hi,
    All you need to do is to create the condition in the discoverer instead of in the query.
    Create a custom folder containing the following sq (note that i removed the condition)l:
    SELECT s.segment1 vendor_number
    ,s.vendor_name
    ,flv1.meaning classification
    ,pca.certificate_number
    ,pca.certifying_agency
    ,pca.expiration_date
    ,flv2.meaning status
    FROM ap_suppliers s
    ,pos_bus_class_attr pca
    ,fnd_lookup_values flv1
    ,fnd_lookup_values flv2
    WHERE pca.vendor_id = s.vendor_id
    AND flv1.lookup_code = pca.lookup_code
    AND flv1.lookup_type = pca.lookup_type
    AND flv2.lookup_code = pca.class_status
    AND flv2.lookup_type = 'POS_BUS_CLASS_STATUSES'
    Then create a discoverer report using this folder using all fields.
    Create a new calculation as (use this exact syntax):
    Sysdate + :No_of_Days_in_the_Future
    Create a new condition:
    pca.expiration_date <= <your calculation>
    To complete it add a sort as you did in the SQL.
    That's it.
    Tamir

  • How can i pass parameter values from html to a shell script

    Hi Guys...
    I had a requirement where i need to execute a sql statement and print the output in HTML page. This report has parameters to enter. So i created a HTML form which accepts parameters. When the submit button is pressed, the action tag in the form invokes unix shell script file. It will open sqlplus and run the sql script file .sql and print the output in the HTML page.
    sql script contains the query and some set options which prints the output in HTML page. Like "SET MARKUP HTML ON"... The query has some parameters like "select * from emp where empno = &&empnumber. I will use the same name "empnumber" while created the HTML parameter form like " <input type = "text" name="empnumber" size="10" align="left">.
    user sees this parameter form and enters some value in to that empno text box.
    My question is how can i catch these parameter values in a shell script and pass it to the sql script to execute it.
    Help Appreciated
    Thanx

    This is a A Bad Idea (tm). This type of CGI processing is old and were (and still is) full of security holes. Very easy to inject stuff (Unix commands and SQL) into it.. To get those parameters into SQL*Plus requires using Unix shell commands to process it - and something like a backquote allows all kinds of nasty stuff to be injected. The Unix shell was never designed to be used as a secure CGI environment.
    There are far better and far superior alternatives. Perl (with Perl_DBI) and PHP (using Zend Core for Oracle) come to mind as web scripting languages.
    Even easier is using HTMLDB. Very few moving parts. Is free. Supports Oracle 9.2 and 10G.

  • How can i pass a value over to a TitleWindow

    Okies as i read from the documentation given by adobe itself
    ... I have only seen examples on how to parse value over to the
    Main application from the title window but not the Main Application
    to the title window.
    What iam trying to do is i wanted to get a selected item from
    a tile list but i wanted to pass it to a swfLoader in a TitleWindow
    Component so that it knows which SWF(in my case ) to search for
    within the specific destination folder.
    What i have tried is to declare a variable to store the
    selectedItem
    example would be ..
    main_application
    public var selectedItem:String =
    "{tileList.selectedItem.Image}";
    titlewindow
    source=
    "assets/data_games/{Application.application.selectedItem}.swf"
    but it seems to be a wrong way to call it ..
    could anyone help me out on how to solve my following
    problems?

    First this forum is intended for questions about Flex
    Builder. Flex language questions should be posted in the Flex
    General Discussion forum.
    That is generally right, but I would build the swf source
    string in a variable first so you can debug it. Do that in a
    handler function on the creationComplete event of the TitleWindow
    Tracy

  • How can i pass a value between tabs

    Hi
    How do i pass values to a particuluar page when that pages tab is clicked on as i need the value to be able to be used for an insert form on the page that it tabs to. You can tab this page from anywhere in the application and i literally just want it to have the same value as the id on page one eg p2_Supervisor_id = :p1_Supervisor_id.
    Obviously i can display the value by either running a query or by making it equal to item p1_Supervisor_id but i cant then use this value for an insert.
    if anyone wants to see the application to see what i am talking about the application number is 26970 and the page is number 2.
    Basically a user logs in and gets to thier details they then can insert thier own project suggestions and past projects but i cant pass thier id to these pages without setting them meaning i cant use them for an insert query.
    If anyone can help i would be extremely grateful.

    Hi sorry
    Bascially when a supervisor logs in succesfully his id is passed to the first page (supervisor details) successfully. There is then a tab menu where he can select to go to either project suggestion or past projects (among other options). Basically as these project suggestion and past projects belong to the supervisor that has logged in i want the id set to the supervisor id that has logged in whenever these two tabs are used. This means that when the page loads the supervisor can input a project suggestion (on the project suggestion page) or a past project (on the past project page).
    The problem i am having at the moment is that before i had buttons that when pressed brached to these pages and set the superviosr id. Now though with tabs i cant seem to find that option that when pressed they set the partiuclar item. Does anyone know how this works with tabs? as i can get the breadcrumbs to work but i cant set the value when the tab is pressed.
    If anyone can help that would be great

Maybe you are looking for

  • Satellite M30-951 graphic card or video BIOS does not work properly

    On the BIOS and boot pages strange characters occur (screenshot www.audioberlin.com/M30-951_SCREEN.jpg). XP boots up but the elements displayed freeze and the display becomes black for a second. The system becomes slow and does not react any longer.

  • How do i retrieve photos from my old iphone to new i phone ?

    i want to retrieve photos on camera roll from old iphone 3g to new iphone 4s how is this done

  • Adobe plugin for Internet Explorer?

    I recently upgraded from XP to Windows 7 Professtional. When I had XP I had a Adobe toolbar plugin that would let me save websites (and MS Word docs) as PDFs. I was able to set options such as compression and image quality for PDFs. Now that I have W

  • Acrobat Pro Print Settings for digital presses

    Hi everyone, I am a digital printer running a xerox 700 digital press with Kodak Creo Rip Software. I have had some issues printing from Acrobat pro where the colors get real dark or distorted. I am sure it is just a color profile issue but I am not

  • Cannot edit tracks in other user account.

    I moved some MP3's over to my other user account and iTunes will not let me rename them. I made sure that the permissions where changed to allow this. The only thing I can find thats different is under the file info, the "locked" check box is grayed