Passing parameter to an Input Help Component

Hi ,
Someone knows a way to pass parameters or any value to an Input Help Component that is built in a separate WDP application ?
Thanks in advance for your help.

Hi Baskaran,
I have a WDP component that implements "".
Then, i use it as search help (F4 function) for an input field  in another WDP component.
I would like to use the same " search help component " for many input fields.
In this purpose, I would like to pass a parameter to specify the caller input field.
So, do you know a way to pass parameters to "the search help component" ?
Here is the tutorial that i followed, for the first part.
[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50fd6096-a4b6-2d10-bfa8-bbd9001e0d0e?quicklink=index&overridelayout=true |http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50fd6096-a4b6-2d10-bfa8-bbd9001e0d0e?quicklink=index&overridelayout=true ]
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50fd6096-a4b6-2d10-bfa8-bbd9001e0d0e?quicklink=index&overridelayout=true

Similar Messages

  • ALV: Search help for editable column using OVS/Input Help Component Usage?

    Hi all,
    Is is possible to assign a value help like OVS or "Input Help Component Usage" to a editable ALV column using Web Dynpro?
    Thanks and regards,
    Ulrich

    Hi Madhu,
    Than I must have made something wrong because this is exactly what I've tried.
    I'll check my freely prgrammed value  and the assigning again.
    Thanks a lot for your quick reply.
    Ulrich

  • Search Help Problem - Passing parameter between to search helps.

    I created following 2 table for entering data in PO screen using ME21N using Custom Data Tab.
    ZSTATE_TAB - State table  (has elementary search help ZSTATE_SH - Value of SCODE is exported)
    SCode(Key)     Description
    S001           New York
    S002          Virginia
    S003          West Virginia
    ZCITY_TAB - City Table  (has elementary search help     ZCITY_SH - Value of SCODE is imported)
    SCode(Key)     CCode (Key)     Description          Level
    S001          C001          New York City          L001
    S001          C002          Rochester          L002
    S001          C003          Buffalo               L003     
    S002          C004          Richmond          L029     
    S002          C005          Fairfax               L030
    I have created an custom input field LEVEL in t-code ME21N in Customer Data Tab.
    I want to create search help for LEVEL using import parameter STATE & CITY .
    On selection screen of search help two selection parameters STATE and CITY are displayed. 
    Step 1:User press F4 for getting list of state and selects any state using search help ZSTATE_SH (Value of SCODE is exported)
    Step 2:User press F4 to get the list of City using search help ZCITY_SH, based on state selected in Step 1.  (Value of SCODE is imported)
    In Step 2, I want to see only the cities selected in Step 1. But instead all Cities are displayed in hit list.
    I also created a table maintenance program SM30 for ZCITY_TAB, the search help ZCITY_SH is correctly displaying the data in hit list according to the State selected in ZSTATE_SH.
    But it is not displaying the correct list for cites in ME21N.
    Kindly help me in fixing this problem.
    Thanks in advance.

    here is the answer from [sap library - Value Transport for Input Helps - Parametrizing the Import Parameters of the Search Help|http://help.sap.com/saphelp_nw2004s/helpdata/en/35/bdb6e2c48411d1950800a0c929b3c3/frameset.htm] :
    If the search help is attached to the table field ( Attaching to Table Fields) or to the check table of the field ( Attaching to Tables), a value transport can take place for all the screen fields that are linked with a parameter of the search help.

  • Help required on Freely Programmed Input help

    Dear all,
    I have developed a component, say comp1, in which i have implemented the interface IWD_VALUE_HELP.
    In the respective view(MAIN) of Comp1 i have a dropdown which contains a list of company codes fetched from T001 table.
    Apart from these two, I have also embedded the Main view into the window WD_VALUE_HELP.
    Now, I have created another component, say Comp2, in which i Used the dynpro component Comp1, and also in the MAIN view of my Comp2. Now in the MAIN view of Comp2 I have created a input field from the node T001 in the context which contains the single attribute BUKRS type String. In the properties of the BUKRS attribute I have also changed the Input help to "Freely Programmed" and linked to the component for the Input help.
    After this, I have created the application for my component Comp2. When i run the application and when i press F4 on the input field i am able to get the window from Comp1 component, and a dropdown with values.
    Now the question is, How can i pass the value selected in that window of Comp1 into the input field of Comp2? we do the same in OVS, when ever a value is selected from the Hitlist, it will be cascaded into the input field, just like that i want to do here.
    Please suggest me how to do this, and also please tell when to go for Freely programmed Input help and its advantages.
    Thank you,
    Shashi.

    You can do as suggested already and use interface nodes and cross component mapping; but that is all really not necessary.  It creates a situation where you calling application is too dependent upon the freely programmed input help.  You want to try to avoid the situation where the calling application needs code or mappings to communicate with the input help.
    That is easy to do because the framework passes all the information you need into the freely programmed input help via the value_help_listener object. 
    Part of the Freeley Programmed Input Help Component should be the component interface IWD_VALUE_HELP.  This comes with a component controller method called SET_VALUE_HELP_LISTENER.  This allows your freely programmed value help to capture this object called listener of type IF_WD_VALUE_HELP_LISTENER. I generally just store it awa into a component controller attribute.
    With this listerner object you have direct access to the context attribute in the calling component. You can query information about the calling UI element and of course set values directly back into it.  The listener is a hugely helpful object and should be the way you interact with the calling component whenever possible.  Here is small example:
      set single attribute
      wd_this->value_help_listener->f4_context_element->set_attribute(
      exporting
        name = wd_this->value_help_listener->f4_attribute_info-name
        value = l_time

  • Help me in passing parameter

    <%@ page import="java.net.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="java.sql.*" %>
    <html>
    <head>
         <title>Untitled</title>
    </head>
    <body>
    <%
         Vector mail = new Vector();
         try{
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         catch (Exception E) {
         out.println("Unable to load driver.");
         E.printStackTrace();
         try{
              Connection C = DriverManager.getConnection("jdbc:mysql://localhost/attendance","root","");
    %>
    <div align="center"><font size="+6">Student BarList</font><br>
    In this page will display out the student that attendance NOT MORE THAN 70%. The Student Below is NOT ALLOW to take exam for the relevant subject.
    The student whoever not satisfy with the bar can negotiate with the lecturer of the relevant subject.<p/>
    The student below will be bar from the relevent subject:
    <%Statement S = C.createStatement();
                   ResultSet rs = S.executeQuery("SELECT * FROM bar");
                   ResultSetMetaData rsStruc = rs.getMetaData();
    out.println("<table bgcolor=red cellpadding=10 cellspacing=1 size=70>");
                   out.println("<tr bgcolor=red>");
                   int colCount = rsStruc.getColumnCount();
                   String colName = "";
                   for(int i=1;i <= colCount; i++){
                   colName = rsStruc.getColumnName(i) ;
                   out.println("<td><B><font color=white>" + colName + "</font></b></td>\n");
                   out.println("</tr>");
                   while (rs.next()) {
                   String email=rs.getString("email");
                   mail.addElement(email);
                   out.println("<tr bgcolor=ffffff>");
                   for(int i=1;i <= colCount; i++){
                   colName = rsStruc.getColumnName(i) ;
                   String fld = rs.getString(colName);
                        out.println("<td>" + fld + "</td>");
                   out.println("</tr>");
                   out.println("</table>");
                   rs.close();
                   C.close();}
    catch (Exception E) {
         out.println("SQLException: " + E.getMessage());
         for(int i=0; i< mail.size(); i++){
    String add= mail.elementAt(i)+",";
    out.println(add);
         %>
    <form action="simplemail.jsp" method="post">
    <input type="text" name="address" value="<%=add%>">
    <input type="submit" name="send" value="Send Mail">
    </body>
    </html>
    what problem with my page i want to read the vector data then set it inside the variable (e.g [email protected],[email protected]) then put it into the textbox and passing parameter to next page.. how i gotta solve this problem?

    i have to use the hidden input html to send the vector to the next page but found out the problem "Type mismatch: cannot convert from String to Vector"
    <%@ page import="java.net.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="java.sql.*" %>
    <html>
    <head>
    <title>Untitled</title>
    </head>
    <body>
    <%
    Vector mail = new Vector();
    try{
    Class.forName("com.mysql.jdbc.Driver");
    catch (Exception E) {
    out.println("Unable to load driver.");
    E.printStackTrace();
    try{
    Connection C = DriverManager.getConnection("jdbc:mysql://localhost/attendance","root","");
    %>
    <div align="center"><font size="+6">Student BarList</font><br>
    In this page will display out the student that attendance NOT MORE THAN 70%. The Student Below is NOT ALLOW to take exam for the relevant subject.
    The student whoever not satisfy with the bar can negotiate with the lecturer of the relevant subject.<p/>
    The student below will be bar from the relevent subject:<br/>
    <%
    Statement S = C.createStatement();
    ResultSet rs = S.executeQuery("SELECT * FROM bar");
    ResultSetMetaData rsStruc = rs.getMetaData();
    out.println("<table bgcolor=red cellpadding=10 cellspacing=1 size=70>");
    out.println("<tr bgcolor=red>");
    int colCount = rsStruc.getColumnCount();
    String colName = "";
    for(int i=1;i <= colCount; i++){
    colName = rsStruc.getColumnName(i) ;
    out.println("<td><B><font color=white>" + colName + "</font></b></td>\n");
    out.println("</tr>");
    while (rs.next()) {
    String email=rs.getString("email");
    mail.addElement(email);
    out.println("<tr bgcolor='ffffff'>");
    for(int i=1;i <= colCount; i++){
    colName = rsStruc.getColumnName(i) ;
    String fld = rs.getString(colName);
    out.println("<td>" + fld + "</td>");
    out.println("</tr>");
    out.println("</table>");
    rs.close();
    C.close();}
    catch (Exception E) {
    out.println("SQLException: " + E.getMessage());
    //String add = "";
    //for(int i=0; i< mail.size(); i++){
    //add = mail.elementAt(i)+",";
    //out.println(add);
    %>
    <form action="simplemail.jsp" method="post">
    <input type="hidden" name="address" value="<%=mail%>">
    <input type="submit" name="send" value="Send Mail">
    </body>
    </html>the vector should be pass to this page:
    <%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %>
    <%
    Vector to2= new Vector();
    to2=request.getParameter("address");
    //String subject=request.getParameter("subject");
    //String message2=request.getParameter("message");
    for(int i=0; i< to2.size(); i++)
         String add = (String)to2.elementAt(i);
         System.out.println(add);
    Properties props = new Properties();
      props.put("localhost:25","localhost:25");
      Session s = Session.getInstance(props,null);
      MimeMessage message = new MimeMessage(s);
      InternetAddress from = new InternetAddress("albert");
      message.setFrom(from);
      InternetAddress to = new InternetAddress(add);
      message.addRecipient(Message.RecipientType.TO, to);
      //message.setSubject(subject);
      //message.setText(message2);
    message.setSubject("Bar exam acknowledgement");
    message.setText("You been bar from the exam, please check on the student attendance online for more information");
      Transport.send(message);
    %>
    <html>
    <p align="center">A Message has been sent.<br>Check your inbox.</p>
    <p align="center"><a href="mail.html">Click here to send another!</a><br>
    </p>
    </html>please help me!!! i stuck in this oledi

  • Pass EL parameter to custom JSF1.2 component

    I've developed simple component, which gets date string from parameter, parses it to Date class, and renders 3 html select tags. Everything goes well if paramters is like '2007-10-25', everything goes nasty when we try to pass parameter like '#{someManager.date}'. Is there any way to render value from #{someManager.date} into '2007-10-25' ? Or some way to handle EL in parameter field?

    I recommend taking a look at some of the components in your JSF implementation to see how they handle getters and setters for properties which accept EL expressions.

  • Pass a datarow as input parameter in a stored procedure

    Hi everyone!
    I wonder if anyone know how to pass a datarow (better if tipized like "tablenameRow") as input parameter for a stored procedure.
    links or suggestions are welcome! (i'm newbie in .net programming, so if you can post some code i'll be really grateful!)
    Thank you!

    Hi,
    YES!! its possible you can pass a datarow to a SP from your Dot net application.
    Here below i'm going to give you an example for Desktop Application.
    For Passing a datarow as Input Parameters, your SP need to support for all these parameters.
    I mean, if a data row has 03 Columns. Then your procedure should be able to take 03 arguments/parameters.
    --Adjust code according to your need.
    --Its for C# Desktop application.
    --Visual Studio Professional, Framework (2.0)
    //Setting connections.
    OracleConnection con=new OracleConnection("Data Source=orcl9i; user id=scott; password=tiger");
    OracleComand cmd=new OracleCommand(con);
    cmd.Type=CommandType.StoredProcedure; //you are useing SP
    cmd.Text="my_stored_procedure"; //Mention SP name.
    --if DataRow has Three columns. You need three parameters.
    OracleParameter p1=new OracleParameter ();//By default parameters are input parameters.
    OracleParameter p2=new OracleParameter ();
    OracleParameter p3=new OracleParameter ();
    //We assume that Datarow already has data in it.
    p1.ParametersName="sp_var1 ";
    p1.OracleDbType=OracleDbType.Varchar;
    p1.Value=tablenameRow[1]; //Here DataRow object's Column1 is input.
    p2.ParametersName="sp_var2 ";
    p2.OracleDbType=OracleDbType.Varchar;
    p2.Value=tablenameRow[2]; //Here DataRow object's Column2 is input.
    p3.ParametersName="sp_var3 ";
    p3.OracleDbType=OracleDbType.Varchar;
    p3.Value=tablenameRow[3]; //Here DataRow object's Column3 is input.
    cmd.OracleParameter.Add(p1); //Add parameters.
    cmd.OracleParameter.Add(p2); //Add parameters.
    cmd.OracleParameter.Add(p3); //Add parameters.
    cmd.ExecuteNonQuery(); //Execute Procedure here.
    Feel free to ask if still found problem.
    ....

  • Pls. help me   -   passed parameter

    I have a procedure "PROC_XXX" that it has one cursor inside. "CUR_XXX"
    I would like to pass parameter that have statement from my trigger etc. "When-button-pressed" to my cursor "CUR_XXX" in procedure "PROC_XXX".
    < v_stmt := 'and v_empno = ...........' >.
    How can i pass ' v_stmt ' to "PROC_XXX " in my DB.
    Thank you very much
    v_stmt is depend on events
    < v_stmt := 'and v_empno between ...........' >.
    < v_stmt := 'or v_empno =< ...........' >.

    Do you already made the procedure? Looks like you could use dynamic sql in the procedure. check out the oracle pl/sql documentation.

  • Can't pass parameter's to a transaction in a new win and skip first screen.

    Dear experts,
    I'm trying to open a  transaction('CV04N') in a new window from a screen that has input box and a pushbutton. I'm trying to pass parameter(DOKNR/'CV1') into the new transaction and skip the first selection-screen. I tried to use Get/Set parameter and that didn't work.
    Also i tried to passing values with batch input and that did pass my values but without skipping the first screen and also it froze the transaction.
    Is there anything I can do to fix this problem?

    Hi Gershon Osmolovski,
    Alvaro is right, CV04N needs to press Execute button. So you need to use Batch Input. If it doesn't work, there must be an error in your code, what messages are returned by SAP? I have tested right now, SAP leaves immediately after the selection screen because there is a code that stops the program if it detects it runs using batch input (SY-BINPT system field). So, you should run CALL TRANSACTION with OPTIONS FROM structured data object (data type CTU_PARAMS, see ABAP documentation for more information), with component NOBINPT='X'. Be careful as an ALV grid is then displayed, you can only simulate the buttons so I advise you to indicate the exaction selection in the selection screen, then press "select all", and execute the function you want.
    If you need more help, paste your code, only useful part.
    BR
    Sandra

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

  • Getting error while adding a custom field (with input help) through AET

    Hi All,
    I need to add two custom field under Service orders at Item level in component BT140I_SRVP.
    One field is required to have the input search help f4 and autopopulates the second field
    I am able to add one field(not requiring help) successfully through AET .
    I have created one Zsearch_help in se11 and its successfully running while I am testing it
    While adding fsecond field through AET,I need to enter following details as -
    field label,search relevant ,serach help etc.
    When I type the name of my 'Zsearch_help' against field search help it gives me following error
    'Search help is not compatible'.
    Please help me out.Kindly be detailed as I am new to SAP CRM.

    Thanks for very helpful reply. After implementing the suggested SAP note, I am able to see the getter and setter methods.
    So one of my problem has got solved with your kind help:)
    As per your another suggestion,I have created the enhanced fields without the search help from AET in the node BTAdminI with names Plant(ZZPLANT) and Storage Location(ZZStoarge_Loc).
    Now I am facing below problem:
    Since Plant needs to autopopulated by Storage Location (search Help ZOFI_SHLP_STORAGE_LOC),So I need to Implement Getter setter method.
    I have written below code into Get_V_ZZStorage_Loc Method:
    method GET_V_ZZSTORAGE_LOC.
      DATA:
        ls_map    TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
        lt_inmap  TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
        lt_outmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.
        ls_map-context_attr = 'ZZSTORAGE_LOC'.
        ls_map-f4_attr      = 'STORAGE_LOC'. (Storage_loc is the parameter defined in search help)
        APPEND ls_map TO: lt_inmap, lt_outmap.
      CREATE OBJECT rv_valuehelp_descriptor TYPE cl_bsp_wd_valuehelp_f4descr
        EXPORTING
          iv_help_id        = 'ZOFI_SHLP_STORAGE_LOC1'
          iv_help_id_kind   = if_bsp_wd_valuehelp_f4descr=>help_id_kind_callback
          iv_input_mapping  = lt_inmap
          iv_output_mapping = lt_outmap.
    endmethod.
    But its not working.Should I write some code in Get_P_XX or some other method also?
    Kindly suggest .

  • Selection from Input help different from PA30 IT0014

    Hi Guys,
    Need advise as i'm trying to get the same result data from input help in IT0014 (wage type). I'm using normal selection from table but the result set are diffrent.
    I'm noticed more value appeared than the input help in IT0014 PA30.
    I checked on the input help seems no parameter passing.
    Attached is the screen for input help .
    Brgds
    Badz

    Finally after few debugging the logic and google searching .
    The answer is because in they wage type appeared in the search help already filtered by employee group and subgroup also personnel area.
    So each user will have different search result/input help  based on their group or pers area.

  • Passing Parameter using GET or Post in J2ME

    I have a problem passing parameter which has space between character to Servlet through GET or POST method. I am using HttpConnection. Which works properly whenever i sending data without space, else it shows Exception for space in URL.
    If i use trim method which is Client side scrpiting then i am not able to update the database which takes input from the J2ME midlet.
    Can any1 help me how to pass the parameter with space.

    Hi Mark,
    The "number" format relies on the formats supported by the JS
    native Number object. We don't actually do any number parsing
    ourselves in Spry. One workaround, if you need things to sort
    properly, is to have one column that is formatted european numbers,
    and one column that is actually supported by the Number object. You
    can create this custom column by using a filter:
    function DataFilter(ds, row, rowIndex)
    row["@premieNumber"] = new
    Number(row["@premieNumber"].replace(/,/, "."));
    return row;
    Regarding the Request() object and your setURL() call ... the
    3rd arg to setURL is optional, and only necessary if you are going
    to use POST, or specify some header to send. If you do use post or
    want to send some specific header, the 3rd arg just has to be an
    object with only whatever options you want to specify, you don't
    have to specify them all ... the options names exactly match the
    fields defined in a Spry.Utils.loadURL.Request object.
    We do have a utility class that gathers all of the input
    values in a form. You will find it in Spry 1.6 in SpryUtils.js. The
    name of the function to call is:
    var str = Spry.Utils.extractParamsFromForm(form, elements);
    The 2nd arg is optional, and allows you to specify what
    element values you want to retrieve. If it is not specified, it
    gets all values in the form.
    --== Kin ==--

  • How to add Freely programmed input help in FPM Search UIBB?

    Hi Experts!
    We have a requirement to create search UIBB in which the input field should have a freely programmed input help.
    I see that WD_VALUE_HELP parameter can be set to the component name and it displays the freely programmed help as well in the application.
    However, I am still digging to implement the search help open and close events of the component.
    I have used the Freely programed value help standard demo object  " FREE_VALUE_HELP "  which shows the value in the help popup however, the selected value is not returned in the input field.
    I am also unable to find any Interface as provided for implementing OVS in search UIBB as well...
    Please help.

    Hi Aliaksandr,
    Thanks for your response.
    I have checked this WDA application demo_value_help .... but it is a normal WDA application.
    However, I want use freely programmed search help in Search UIBB using FPM.
    I found that we can provide the component name used as freely programmed search help in the attribute WD_VALUE_HELP of Interface IF_FPM_GUIBB_SEARCH.
    https://help.sap.com/saphelp_nw74/helpdata/en/03/f2474b6d9a49f4b5a3ed6f04decf22/content.htm?frameset=/en/56/d151c3ba7b4b2e82068a084cb991f3/frameset.htm
    And it displays the search help as well when I do F4 on the field of Search UIBB. But, we need to provide event handler for events - VH_WINDOW_CLOSED and VH_WINDOW_OPENED of the search help component (Component which is provided in WD_VALUE_HELP) some where in the Feeder class, in order to get the selecteed data from the search help, which I am unable to do.
    Do you have any idea of such implementation?
    Appreciate your response!

  • Pass Parameter to Servlet

    How can i pass parameter from a JSP form (depends on what user chooses from a select box to a Servlet.
    I need to call multiple query based on what parameter choosen and display the result in table view.
    Example :
    1. User select choice1 from JSP form -> Servlet : call query Select * from Table1 where cond = choice1;
    2. User select choice2 from JSP form -> Servlet : call query Select * from Table1 where cond = choice2;
    Any sample code?
    Thanks for any help.

    Thanks melondck.
    I have this Servlet which i want it to run queries and display results in table format. I know there's something wrong with the code. But i am new to Servlet/Java. Thanks for anyone who point me the mistakes. Thanks.
    <code>
    package mypackage;
    import java.sql.*;
    import javax.servlet.http.*;
    import java.io.*;
    import javax.servlet.*;
    public class DisplayServlet extends HttpServlet {
    public void doGet(HttpServletRequest req, HttpServletResponse rsp)
    throws ServletException, IOException {
    rsp.setContentType("text/html");
    String url="jdbc:mysql://localhost/smdb";
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    String query;
    ServletOutputStream out = rsp.getOutputStream();
    PrintWriter out1 = rsp.getWriter();
    String answer = req.getParameter("answer");
    out1.println("<html>");
    out1.println("<head><title> Inventory: </title></head>");
    out1.println("<body>");
    if (answer == null) {
    StringBuffer action = HttpUtils.getRequestURL(req);
    out1.println("<form action=\"" + action + "\" method=\"POST\">\n");
    out1.println("<p><b>Please select:</b></p>");
    out1.println("<p><input type=\"radio\" name=\"answer\" " +
    "value=\"A\" /> Display All <br />");
    out1.println(" <input type=\"radio\" name=\"answer\" " +
    "value=\"B\" /> Device <br />");
    out1.println(" <input type=\"radio\" name=\"answer\" " +
    "value=\"C\" /> Manufacturer <br />");
    out1.println(" <input type=\"radio\" name=\"answer\" " +
    "value=\"D\" /> Location <br />");
    out1.println(" <input type=\"submit\" value=\"Submit\" /></p>");
    out1.println("</form>");
    } else {
    try {
    Class.forName("com.mysql.jdbc.Driver");
    con = DriverManager.getConnection (url, "user", "mypass");
    stmt = con.createStatement();
    if (answer.equals("A")) {
    query = "SELECT Device, LocFloor FROM Inventory";
    esleif (answer.equals("B)) {
    query = "SELECT Device, LocFloor FROM Inventory where ....";
    ResultSet result = stmt.executeQuery(query);
    //Display the result set in a HTML table
    out.println("<HTML><HEAD><TITLE>List</TITLE></HEAD>");
    out.println("<BODY>");
    out.println("<FORM NAME='form' ");
    out.println("METHOD='GET'><TABLE BORDER='1' CELLSPACING='2' CELLPADDING='2'>");
    out.println("<TR><TH></TH><TH>Device Type</TH><TH>Floor</TH></TR>");
    while(result.next()) {
    String type = result.getString("Device");
    String flr = result.getString("LocFloor");
    out.println("<TD>" + type + "</TD>");
    out.println("<TD>" + flr + "</TD>");
    catch(ClassNotFoundException e) {
    out.println("Could not load database driver: " + e.getMessage());
    catch(SQLException e) {
    out.println("SQLException caught: " + e.getMessage());
    finally {
    //close the database connection.
    try {
    if (con != null) con.close();
    catch (SQLException e) {}
    out.println("</body></html>");
    </code>

Maybe you are looking for

  • MacBook Pro loses connection to Internet after sleep using Airport Time Capsule

    I recently upgraded to Mavricks and then added a new Airport Time Capsule, and now I my MBP will not connect to the wireless LAN after waking up from sleep mode.  My MBP worked great for over a year with an non-Apple router, so I am thinking that the

  • Help :- Send Large File From Server To Client

    Hey guys, I am stuck with a problem.Hope u guys might be able to help me out. My problem is :- From client i am doing an operation which results in calculation of results by server and saving a file on the server..But i want to see what results have

  • Adobe Echosign included in Adobe Full CC?

    HI all, i was just going through acrobat. Learning how to sign documents etc when I came across Echosign. It's a superb solution. I tried a few documents with friends to see how it works. I am a full cc subscriber but not sure if Echosign is a part o

  • Photos printing, unable to fill picture

    I am trying to print an image in Photos for OSX. When i hit print I am shown the image preview, and selection of printer, paper size and settings. The thumbnail for 4x6 looks fine, but when I have selected it and hit print, I reach a new screen, simi

  • Creating template areas when using CSS based layout

    Hi: I'm ransitioning to pure CSS based layouts. When I used tables for layouts I could select a table cell and make that an editable template region. But when I'm setting everything up in Divs, you can't "select" a div in Layout mode. Indeed, layout