How to "encapsulate" a data from a text field in a JSP form

Hi. I'm trying to make a user's registration jsp page and I'm not sure how I could get the data from a JSP form from the user and store that into some variable that I could later pass to a query to modify the database. I've been using a JavaBean, but I get null values for all the fields of the jsp page. That's logical, since I cannot find a method that will read the user's input and store that into some variable. In my JavaBean, I have get and set methods that will return a String for each of the form fields such as first name and email. The set method will have in a String as a parameter to set that field value (whichever field it is) to the value of the input parameter, but I don't know if there is a method or a way to read and store the values entered by the user into the jsp form. This is a code snippet of the jsp form:
<TR><TD>First Name: </TD>
<TD><INPUT TYPE="TEXT" NAME="fname"
               VALUE="<%= newUser.getFirstName() %>"></TD></TR>
Here, the getFirstName() method simply returns the value of a String value related to the user's first name, which is initialized as null in the JavaBean. newUser is the name of the JavaBean that I'm using.
Any suggestions? Thanks.

haha...nevermind this question also guys...I found out that I could use the request.getParameter("some_String") method with my JavaBean to read and store data entered by the user in a text field.

Similar Messages

  • How to retrieve multiple data from table and represent it in jsp page

    Hi
    The below JavaScript code is used to add row in the table when I want to add multiple row data into table for single entry no field.
      <html>  function addRow()
                i++;
                var newRow = document.all("tblGrid").insertRow();
                var oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='srno"+i+"' type='text' id='srno"+i+"' size=10>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmcd"+i+"' type='text' id='itmcd"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmnm"+i+"' type='text' id='itmnm"+i+"' size='15'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='indentqty"+i+"' type='text' id='indentqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                    oCell.innerHTML = "<input name='uom"+i+"' type='text' id='uom"+i+"' size='10'><input type='hidden' name='mcode"+i+"'id='mcode"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packqty"+i+"' type='text' id='packqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packuom"+i+"' type='text' id='packuom"+i+"' size='10'><input type='hidden' name='pack"+i+"' id='pack"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='rate"+i+"' type='text' id='rate"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='dor"+i+"' type='text' id='dor"+i+"' size='0' onClick='"+putdate(this.name)+"'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='bccode"+i+"' type='text' id='bccode"+i+"' size='10'></td><input type='hidden' name='bcc"+i+"' id='bcc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='cccode"+i+"' type='text' id='cccode"+i+"' size='10'></td><input type='hidden' name='ccc"+i+"' id='ccc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='remark2"+i+"' type='text' id='remark2"+i+"' size='20'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input type='button' value='Delete' onclick='removeRow(this);' />";
               // oCell = newRow.insertCell();
               // oCell.innerHTML = "<input type='button' value='Clear' onclick='clearRow(this);' />";
            }<html>  Then this data are send to the next Servlet for adding into two table.
    My header portion data are added into one table which added only one row in table. while footer section data are added into the no of rows in another table dependent on No. of
    Rows added into jsp page.
    Here is an code for that logic.
    <html>
    ArrayList<String> mucode = new ArrayList<String>();
                                ArrayList<Integer> serials = new ArrayList<Integer>();
                                ArrayList<Integer> apxrate = new ArrayList<Integer>();
                                ArrayList<Integer> srname = new ArrayList<Integer>();
                                ArrayList<String> itcode = new ArrayList<String>();
                                ArrayList<String> itname = new ArrayList<String>();
                                ArrayList<Integer> iqnty = new ArrayList<Integer>();
                                ArrayList<String> iuom = new ArrayList<String>();
                                ArrayList<Integer> pqnty = new ArrayList<Integer>();
                                ArrayList<String> puom1 = new ArrayList<String>();
                               ArrayList<Integer> arate = new ArrayList<Integer>();
                                ArrayList<String> rdate = new ArrayList<String>();
                                ArrayList<String> bcs = new ArrayList<String>();
                                ArrayList<String> ccs = new ArrayList<String>();
                                ArrayList<String> remarkss = new ArrayList<String>();
                                //ArrayList<Integer> qtyrecs = new ArrayList<Integer>();
                                //ArrayList<String> dors = new ArrayList<String>();
                                //ArrayList<String> remarks = new ArrayList<String>();
                     String entryn = request.getParameter("entryno");       
                        String rows = request.getParameter("rows");
                        out.println(rows);  
                        //String Entryno = request.getParameter("entryno");
                       // out.println(Entryno);
                      int entryno = 0,reqqty = 0,srno = 0,deprequest = 0,rowcount = 0;
                                if(!Entryno.equals("")){
                                        entryno = Integer.valueOf(Entryno);
                                if(!rows.equals("")){
                                        rowcount = Integer.valueOf(rows);
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                serials.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                                out.println(serials.size());
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                srname.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                out.println(srname.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmcd"+i)!=null){
                                                itcode.add(request.getParameter("itmcd"+i).trim());
                                        } //out.println(itcode.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmnm"+i)!=null){
                                                itname.add(request.getParameter("itmnm"+i).trim());
                                        }//out.println(itname.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("indentqty"+i)!=null){
                                                iqnty.add(Integer.valueOf(request.getParameter("indentqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("uom"+i)!=null){
                                                iuom.add(request.getParameter("uom"+i).trim());
                                        }//out.println(iuom.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("mcode"+i)!=null){
                                                mucode.add(request.getParameter("mcode"+i).trim());
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("packqty"+i).equals("")){
                                          pqnty.add(0);
                                        }else
                                            pqnty.add(Integer.valueOf(request.getParameter("packqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("pack"+i)!=null){
                                                puom1.add(request.getParameter("pack"+i).trim());
                                       }else
                                        puom1.add("");
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i).equals("")){                                     
                                            arate.add(0);
                                        }else
                                        arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));   
                     /* for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i)!=null){
                                                arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
                              for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dor"+i)!=null){
                                                try{
                                                        rdate.add(dashdate.format(slashdate.parse(request.getParameter("dor"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                                        }else
                                           { rdate.add("");}
                                   for(int i=1;i<=rowcount;i++){
                                 if(request.getParameter("bcc"+i)!=null){
                                                bcs.add(request.getParameter("bcc"+i).trim());
                                        }out.println(bcs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("ccc"+i)!=null){
                                                ccs.add(request.getParameter("ccc"+i).trim());
                                        }out.println(ccs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                    out.println("remark2");
                                        if(request.getParameter("remark2"+i)!=null){
                                                remarkss.add(request.getParameter("remark2"+i).trim());
                                        }out.println(remarkss.get(0));
                        ArrayList<String> Idate = new ArrayList<String>();
                        for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dateindent"+i)!=null){
                                                try{
                                                        Idate.add(dashdate.format(dashdate.parse(request.getParameter("dateindent"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                    String Rdate = dashdate.format(new java.util.Date());
                     String tdate = dashdate.format(new java.util.Date());    
                     // String Indentdate = dashdate.format(new java.util.Date());
                   //  String ApprovedT1 = dashdate.format(new java.util.Date());
                   //  String ApprovedT2 = dashdate.format(new java.util.Date());
                       // String ApprovedT1=" ";
                        //String ApprovedT2="";*/
                    String ApprovedT1= dashdate.format(new java.util.Date());
                   out.println (ApprovedT1);
                      String ApprovedT2=dashdate.format(new java.util.Date());
                       out.println(ApprovedT2);
                    String Indentdate=(dashdate.format(slashdate.parse(request.getParameter("dateindent").trim())));
                       out.println(Indentdate);
                        String Cocode ="BML001";  
                        out.println(Cocode);
                        String Deptcode = request.getParameter("dept1");
                        out.println(Deptcode);
                        String Empcode = request.getParameter("emp");
                        out.println(Empcode);
                        String Refno =request.getParameter("rtype"); 
                         out.println(Refno);
                        String Divcode = request.getParameter("todiv1");
                        out.println(Divcode);
                        String Usercode = "CIRIUS";    
                         String Whcode = request.getParameter("stor");
                        out.println(Whcode);
                        // String Itemgroupcode = request.getParameter("");
                         String Itemgroupcode ="120000";
                         out.println(Itemgroupcode);
                        String Supplytypecode = request.getParameter("stype");
                        out.println(Supplytypecode);
                        String Delcode = request.getParameter("deliverycode");
                        out.println(Delcode);
                        String Itemclass="WS";
                        out.println(Itemclass);
                        // String Itemclass = request.getParameter("iclass");
                       // out.println(Itemclass);
                        String unitcode = request.getParameter("uni");
                        out.println(unitcode);
                         String Todivcode = request.getParameter("todiv1");
                        out.println(Todivcode);
                        String Appxrate = request.getParameter("rate");
                        out.println(Appxrate);
                        String Srno = request.getParameter("srno");
                        out.println(Srno);                
                    /*    String Indqty = request.getParameter("indentqty");
                      out.println(Indqty);*/
                  String Itemcode = request.getParameter("itmcd");
                       out.println(Itemcode);
                       String Othersp = request.getParameter("remark1");
                        out.println(Othersp);
                        String Reqdt = request.getParameter("dor");
                        out.println(Reqdt);
                        String Munitcode = request.getParameter("mcode");
                        out.println(Munitcode);
                        String Packqty = request.getParameter("packqty");
                        out.println(Packqty);               
                        String Packuom = request.getParameter("pack");
                        out.println(Packuom);
                        String Remark2 = request.getParameter("remark2");
                        out.println(Remark2);
                        String BC = request.getParameter("bcc");
                        out.println(BC);
                        String CC = request.getParameter("ccc");
                        out.println(CC);
                        try{
                            st=connection.createStatement();
                            connection.setAutoCommit(false);
                            String sql="INSERT INTO PTXNINDHDR(COCODE,DEPTCODE,EMPCODE,APPROVEDT1,APPROVEDT2,INDDT,ENTRYNO,REFNO,REMARKS,DIVCODE,USERCODE,WHCODE,ITEMGROUPCODE,SUPTYPECODE,DELCODE,UNITCODE,TODIVCODE,ITEMCLASS)VALUES('"+Cocode+"','"+Deptcode+"','"+Empcode+"','"+ApprovedT1+"','"+ApprovedT2+"','"+Indentdate+"',"+Entryno+",'"+Refno+"','"+Othersp+"','"+Divcode+"','"+Usercode+"','"+Whcode+"','"+Itemgroupcode+"','"+Supplytypecode+"','"+Delcode+"','"+unitcode+"','"+Todivcode+"','"+Itemclass+"')";
                            out.println(sql);
                            st.addBatch(sql);
                            for(int i=0;i<serials.size();i++){
                                out.println("Inside the Statement");
                                String query3="test query for u";
                                out.println(query3);
                               String queryx="Insert into PTXNINDDTL(APXRATE,ENTRYNO,BRKNO,INDQTY,ITEMCODE,OTHERSPFCS,MUNITCODE,PACKQTY,PACKUOM,REMARKS,DIMSUBGRPCODE,DIMCODE,REQDT)VALUES("+arate.get(i)+","+entryno+","+srname.get(i)+","+iqnty.get(i)+","+itcode.get(i)+",'"+Othersp+"','"+mucode.get(i)+"',"+pqnty.get(i)+",'"+puom1.get(i)+"','"+remarkss.get(i)+"','"+bcs.get(i)+"','"+ccs.get(i)+"','"+rdate.get(i)+"')";
                               out.println(queryx);
                                st.addBatch(queryx);
                           int[] result=st.executeBatch();
                           connection.commit();
                           for(int k=0;k<result.length;k++)
                           out.println("rows updated by "+(k+1)+"insert sta:"+result[k]+"");
                        catch(BatchUpdateException bue)
                        out.println("error1;"+bue+"");
                        catch(SQLException sql)
                        out.println("error2;"+sql+"");
                        catch(Exception l)
                        out.println("error3;"+l+"");
    </html>
       Now I looking for to retrieve this footer section data available in multiple rows from footer table and present it in jsp page .
    I am finding difficulties in how to show this multiple row data for dynamic no of rows .i.e. variable no. of rows.
    I have able to show the data in Header portions of page in this ways
    here i am adding the part of code which shows the data from header part of table i.e from Header table
      <html>
    <h2 align="center"><b>Indent Preparation</b></h2>
        <div align="left">
            <table width="849" border="0" cellspacing="3" cellpadding="3" align="center">
                <tr>
                    <td ><div align="left"><b>Indent No.</b></div></td>
                    <td ><label>
                            <input name="indentno" type="text" id="indentno" size="15" value="" /><input type="hidden" name="no" id="no">
                    </label></td>
                    <td ><div align="center"><strong>Indent Date</strong></div></td>
                    <td ><label>
                            <div align="center">
                                <input name="dateindent" type="text" id="dateindent"value="<%=date1%>"/><input type="hidden" name="no" id="no">
                            </div>
                    </label></td>
                    <td> </td>
                    <td><div align="right"><strong>Entry No.</strong></div></td>
                     <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
            <td><input type="text" value="<%=hdrcode.get(3)%>" size="10"></td>
    <%}else{%>
                   <td><input type="text" name="entryno" id="entryno" value="<%=entryNo%>"/></td>
                             <%}%>
                            <div align="right"></div>
                </tr>
                <tr>
                    <td><b>Division</b></td>
                    <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(9)%>" size="20"</td>
    <td><input type="hidden" name="div1" id="div1" value='<%=hdrcode.get(10)%>'></td>
    <%}else{%>
                   <td><input type="text" name="div" id="div" /></td>
                   <td><input type="hidden" name="div1" id="div1" /> </td>
              <%}%>
                    <td> </td>
                    <td> </td>
                    <td><div align="right"><strong>Unit</strong></div></td>
                   <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(14)%>" size="20"</td>
    <td><input type="hidden" name="uni" id="uni" value='<%=hdrcode.get(12)%>'></td>
    <%}else{%>
                   <td><input type="text" name="unit" id="unit" /></td>
                   <td><input type="hidden" name="uni" id="uni" /> </td>
              <%}%>
                </tr>
                <tr>
    </html>
      Any suggestion on any above works is highly appreciated.
    Thanks and regards
    harshal

    Too much code. It's also not well intented nor formatted. I don't see a question either or it got lost in that heap of unformatted code.
    I will only answer the question in the thread's subject:
    How to retrieve multiple data from table and represent it in jsp pageTo retrieve, make use of HttpServletRequest#getParameterValues() and/or #getParameter().
    To display, make use of JSTL's c:forEach.

  • How do you read data from a text file into a JTextArea?

    I'm working on a blogging program and I need to add data from a text file named messages.txt into a JTextArea named messages. How do I go about doing this?

    Student_Coder wrote:
    1) Read the file messages.txt into a String
    2) Initialize messages with the String as the textSwing text components are designed to use Unix-style linefeeds (\n) as line separators. If the text file happens to use a different style, like DOS's carriage-return+linefeed (\r\n), it needs to be converted. The read() method does that, and it saves the info about the line separator style in the Document so the write() method can re-convert it.
    lethalwire wrote:
    They have 2 different ways of importing documents in this link:
    http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html
    Neither of those methods applies to JTextAreas.

  • How can I plott data from a text file in the same way as a media player using the pointer slide to go back and fort in my file?

    I would like to plott data from a text file in the same way as a media player does from a video file. I’m not sure how to create the pointer slide function. The vi could look something like the attached jpg.
    Please, can some one help me?
    Martin
    Attachments:
    Plotting from a text file like a media player example.jpg ‏61 KB

    HI Martin,
    i am not realy sure what you want!?!?
    i think you want to display only a part of the values you read from XYZ
    so what you can do:
    write all the values in an array.
    the size of the array is the max. value of the slide bar
    now you can select a part of the array (e.g. values from 100 to 200) and display this with a graph
    the other option is to use the history function of the graphes
    regards
    timo

  • How to do import data from the text file into the mathscript window?

    Could anyone tell me how to do import data from text file into mathscript window for labview 8?
    MathScript Window openned, File, Load Data - it has options: custom pattern (*.mlv) or all files. 
    Thanks

    Hi Milan,
    Prior to loading data in Mathscript Window , you have to save the data from the Mathscript window (the default extension of the file is .mlv but you can choose any extension). This means that you cannot load data from a text file  that was not created using the Mathscript window.
    Please let me know if you have any further questions regarding this issue.
    Regards,
    Ankita

  • How to make html file from a text field data

    hi!
    I want to know how to make a file with .html extension and the data in this file should be from a text field. like i want to enter some thing in a text area and have to place it in a file on server side in html formate.

    so you told us what you want, but what is your question?

  • How to load Test data from a Text file in ECATT

    Hi,
    I have created a test configuration with a test script, system data container, and test data container.
    I have done the recording of a transaction and created the script. Parameterization is done for the script and have imported those parameters from script in to the data container.
    I am trying to load a the data from a text file on the local work-station. The data is not being read.
    Please explain this in detail (step by step) as I am very new to ECATT.
    I am trying this on SAP ECC 6.0 IDES server.
    Thanks in Advance
    Vikas Patil

    Please explain this in detail (step by step) as I am very new to ECATT.
    Thanks in Advance
    Vikas Patil

  • How to load the data from excel file into temprory table in Forms 11g?

    Hi
    How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
    My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
    Kindly Suggest the Solution.
    Regards,
    Sachin

    Declare
        v_full_filename         varchar2(500);
        v_server_path           varchar2(2000);
        v_separator             VARCHAR2(1);
        v_filename              VARCHAR2(400);
        filename                VARCHAR2 (100);
        v_stop_load             varchar2 (2000);
        v_rec_error_log         varchar2(4000);
        v_error_log             varchar2(4000);
        ctr                     NUMBER (12);
        cols                    NUMBER (2);
        btn                     number;
        RES                     BOOLEAN;   
        application             ole2.obj_type;
        workbooks               ole2.obj_type;
        workbook                ole2.obj_type;
        worksheets              ole2.obj_type;
        worksheet               ole2.obj_type;
        cell                    ole2.obj_type;
        cellType                ole2.OBJ_TYPE;
        args                    ole2.obj_type;
        PROCEDURE olearg
        IS
        args   ole2.obj_type;
        BEGIN
        args := ole2.create_arglist;
        ole2.add_arg (args, ctr);                                
        ole2.add_arg (args, cols);                                   
        cell := ole2.get_obj_property (worksheet, 'Cells', args);
        ole2.destroy_arglist (args);
        END;
    BEGIN
    v_full_filename := client_get_file_name(directory_name => null
                                     ,file_name      => null
                                     ,file_filter    => 'Excel  files (*.xls)|*.xls|'  
                                                                            ||'Excel  files (*.xlsx)|*.xlsx|'                                                                 
                                     ,message        => 'Choose Excel file'
                                     ,dialog_type    => null
                                     ,select_file    => null
    If v_full_filename is not null Then
    v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
    v_filename := v_separator||v_full_filename ;
    :LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);                                
    RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));     
    --Begin load data from EXCEL
    BEGIN
        filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
        application := ole2.create_obj ('Excel.Application');
        ole2.set_property (application, 'Visible', 'false');
        workbooks := ole2.get_obj_property (application, 'Workbooks');
        args := ole2.create_arglist;
        ole2.add_arg (args, filename); -- file path and name
        workbook := ole2.get_obj_property(workbooks,'Open',args);
        ole2.destroy_arglist (args);
        args := ole2.create_arglist;
        ole2.add_arg (args, 'Sheet1');
        worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
        ole2.destroy_arglist (args);
        ctr := 2;                                                     --row number
        cols := 1;                                                -- column number
        go_block('xxx');
        FIRST_RECORD;  
        LOOP       
                --Column 1 VALUE --------------------------------------------------------------------
            olearg;
            v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            :item1 := v_stop_load;
            cols := cols + 1;                                                      
              --Column 2 VALUE --------------------------------------------------------------------
            olearg;
            :item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            cols := cols + 1;
            --<and so on>
        ole2.invoke (application, 'Quit');
        ole2.RELEASE_OBJ (cell);
        ole2.RELEASE_OBJ (worksheet);
        ole2.RELEASE_OBJ (worksheets);
        ole2.RELEASE_OBJ (workbook);
        ole2.RELEASE_OBJ (workbooks);
        ole2.RELEASE_OBJ (application);
    END;
    --End load data from EXCELPlease mark it as answered if you helped.

  • Data from one text field to another text field on the next page

    Hi all,
    Hi I have a form, which has data coming in from the data binding, the thing is the data is mapped to a certain text field and if that text field is filled up it should be continued on to the other text field which is on the immediate page following it. the reason for using text field instead of  Subform and make it expandable is  the client does not want to change the position and structure of other fields following that field, they are o.k with the amount overflowed in to the next text field .
    is there any script for the same condition in Java script or form calc.
    Thanks in advance.
    de1209

    This is not as simple as it sounds. You will not be able to split the field up during the time of binding. The entire string must go into the field and only after it has completed the biinding can we change it around. A colleage of mine did this for an interactive field and it involved some pretty complicated code. Here is a link to her blog entry that describes what she did:
    http://blogs.adobe.com/lcdesigner/2008/07/an_example_of_splitting_text_a.html
    But that is only part of the problem.....once you split the information across two fields you will need to recombine it back into a single field so that the data that is submitted can represent it correctly again. So you will have to reverse the process in a presubmission step.
    Make sense?
    paul

  • How to store/manipulate Date and long text fields with Dictionary project

    I am able to save string values into my backend (SQL Server) database in my web dynpro project but I am getting errors dealing with my date string and my long text (comments) field. 
    I want to figure out both how I need to define the fields in the dictionary project, how to define the context variables in web dynpro, and how to code the statements to pull the values out of the context and into fields I can use in my SQL insert. 
    Currently I have the date defined in the dictionary project as "date" and the comments as a 256-character string. 
    In the web dynpro context I have the date field defined as "date" and the comments field defined as "string".  Should I define a 256-character string type and use that as field type??
    In the code I am using the following to get the values:
         String s9 = (String) wdContext.nodeReceipt().getElementAt(wdContext.nodeReceipt().getLeadSelection()).getAttributeValue("Comments");
    String s5 = (String) wdContext.nodeReceipt().getElementAt(wdContext.nodeReceipt().getLeadSelection()).getAttributeValue("DateReceived");
    SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy");
         try {
         Date dt = sdf.parse(s5);
         } catch (Exception e) {
              e.printStackTrace();
    I then try to insert all of my values with the following code:
    InitialContext ctx = new InitialContext();
      javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("jdbc/SAP/BC_JMS");
      java.sql.Connection con = ds.getConnection();
      java.sql.Statement stmt = con.createStatement();
      stmt.executeUpdate("insert into AVD_GEN_REC(VENDOR,DATE_RECEIVED,TOTAL_PIECES,LOGGED_BY," +
           "ADDRESSED_TO,BLDG_NO,CARRIER,TRACKING_NO, COMMENTS) values('s1','s5','s2','s6','s3','s7','s4','s8','s9')");
       } catch (Exception e) {
             wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Exception "+e.getMessage());
    Any help/ideas would be appreciated...

    The comment error seems to have resolved itself but I still get an error with the date field:
    Exception The SQL statement "INSERT INTO "AVD_GEN_REC" ("VENDOR","DATE_RECEIVED","TOTAL_PIECES","LOGGED_BY","ADDRESSED_TO","BLDG_NO","CARRIER","TRACKING_NO","COMMENTS") VALUES ('s1','d5','s2','s6','s3','s7','s4','s8','s9')" contains the semantics error[s]: type check error: new value (element number 2) is not assignable to column "DATE_RECEIVED" 
    The DATE_RECEIVED is defined in the data dictionary as "date", the context variable "DateReceived" is also a "date", and the statement to pull d5 is being stored to a "Date".  Is there a difference between the "Date" and "date"?
    Date d5   = wdContext.currentReceiptElement().getDateReceived();

  • How to insert a date picker input text field in a JSF Jsp page

    Hi,
    I have to develop an application using generic facets, unfortunately I am not supposed to use ADF Faces components given by Oracle.
    Now my requirement is, on JSP page an input text field which holds a DATE value is required, it should also have a Date Picker Calendar adjacent to it.
    Could you pls shed some light on this issue and help me out.
    Thanks
    ~Siva(ji)

    <HTML>
    <script language="JavaScript" type="text/javascript">
    <!--
    var pUpWidthc = 300; //Change the pUpWidthc to your requirements.
    var scrAvailc = 400;     //Change to your available screen width. You see in
    //this eBooks' middle frame, the frame width is
                                                                //equal to 410 . So whether your using frames or
                                                                //or a full 800 pixel screen, you must calculate
                                                                //your available screen width.
    var PopUpC = document.getElementById("pUpc");
    document.write('<div id="pUpc" style="visibility:hidden;z-index:4;width:'+pUpWidthc+';position:absolute;"></div>');
    function cstmPup(objC,c){
    popUpC = document.getElementById("pUpc");
    popUpC.innerHTML = c.innerHTML
    popUpC.style.left = getPos(objC,"Left");
    var scrNeedc = getPos(objC,"Left") + pUpWidthc;
    if (scrNeedc > scrAvailc){
    //The number 10 below is an extra offset x value applied when the
    //definitional popup box positions beyond your screen width. You
    //can change this number to fine tune your "beyond screenwidth" positioning.
    var scrOffsetC = getPos(objC,"Left") + pUpWidthc - (scrAvailc);
    popUpC.style.left = getPos(objC,"Left") - (scrOffsetC - 0);
    popUpC.style.top = getPos(objC,"Top") + objC.offsetHeight;
    popUpC.style.visibility = 'visible';
    fill();
    function fill()
         var noOfRows=7,noOfCols=7,i=0,j=0,day=1,x;
    var d1=FirstDayOfWeek(7,2008);
    //40     
         for(i=1;i<noOfRows;i++)
              x=document.getElementById('myTable').insertRow(i);
              for(j=0;j<noOfCols;j++)
                   var y=x.insertCell(j);
                   if( ( i==1 && j<d1))
                   y.innerHTML="";
                   else if(day<=DaysInMonth(7,2008)){
                   y.innerHTML=day;
                   day++;
    //document.write(FirstDayOfWeek(7,2008));
    function FirstDayOfWeek(m,y)
    var i;
    var dow = 6;
    //document.write("Hello");
    for (i=1583; i<y; i++)
    dow += (LeapYear(i)) ? 2 : 1;
    for (i=1; i<m; i++)
    dow += DaysInMonth(i,y);
    return dow % 7;
    function DaysInMonth(m,y)
    // m is the month number (1,2,3,...12), y is the year number (four digits)
    switch (m)
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12: return 31;
    case 2: if (LeapYear(y))
    return 29;
    else
    return 28;
    default: return 30;
    function LeapYear(y)
    return (y % 4==0) && ((y % 100!=0) || (y % 400==0));
    function getPos(objC,sPos){
    var iPos = 0;
    while (objC != null) {
    iPos += objC["offset" + sPos];
    objC = objC.offsetParent;}
    return iPos;
    function hPopUpc(){
    popUpC = document.getElementById("pUpc");
    popUpC.style.visibility = 'hidden';
    //-->
    </script>
    <BODY
    <button id="c1" onclick="cstmPup(c1,pUpCstm)">Custom PopUp</button>
    <'div' id="pUpCstm" style="display:none;">
    <'div' id="myid" align="left" style=" width:100%; height:100%; background:#cccccb; border:1px solid black; border-top:1px solid white; border-left:1px solid white; padding:10px; font:normal 10pt tahoma; padding-left:18px "> <b>Rich Message Boxes</b>
    <hr size="1" style="border:1px solid black;">
         <div style="width:220px; font-family:tahoma; font-size:80%; line-height:1.5em"><br>
              <table border ="1" id="myTable">
                   <TR>
                        <TD> SUN </TD>
                        <TD> MON </TD>
                        <TD> TUE </TD>
                        <TD> WED </TD>
                        <TD> THU </TD>
                        <TD> FRI </TD>
                        <TD> SAT </TD>
                   </TR>
              </table>
         <br><br>
         </div>
         <br>
         <div>
    <button tabindex="-1" onclick="hPopUpc()" style="border:1px solid black; border-left:1px solid white; border-top:1px solid white; background:#cccccc ">Close Message</button>
    </div>
    <?BODY
    </HTML>
    Message was edited by:
    mchepuri
    Message was edited by:
    mchepuri
    Message was edited by:
    mchepuri

  • How to retrieve specific data from a text file

    Hi, everyone
    For my project it is required that a parameter file is read at the beginning, in order for certain variables to be initialized with specific values that change with the user.
    At the moment, the way it is done is the following:  The values at a specified sequence in a text file are read and saved in an array and the elements of the array are retrieved according to their index.
    The problem with this implementation is, that if for some reason the format of the file changes, e.g. we want to use a parameter file from a previous version of the program that has the values for the same variables but in a different order, the only way to have the right values for the parameters is to change everything accordingly, which is really time wasting.
    Could someone suggest a different implementation that would make the reading of the different values independent from their order in the file, e.g. by scanning the file for specific strings and reading the value after the string?
    Thank you very much.
    P.S. I have  attached a screenshot of the routine I am using now.
    Solved!
    Go to Solution.
    Attachments:
    read parameter file.JPG ‏180 KB

    Hi panagiov,
    Find attached Folders.
    Method 1: in this you can search for each variable separately. You can use "Config file vis" to get all keys(Variables) at once and then you can use for loop to get their values. Or you can access individual values as shown in this code.
    Method 2: here you will get all data at once. You will get Variable and Data (2D array) You need to search variables as and when required.
    I hope you will understand these methods.
    Best of luck
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.
    Attachments:
    Method 1.zip ‏7 KB
    Method 2.zip ‏9 KB

  • How to automate loading data from a text file ?

    Hi,
    I need to load a data form a text file automatically. (for example: every day at 6.p.m) .
    It is possible to use DBMS_SCHEDULER with SQL LOADER ? or maybe u have others idea ?
    regards,

    assuming that the text file resides at the machine where the database is installed at you can create a procedure that use the built-in UTL_FILE package to read and load the data to the oracle tables. then create a job that use the DBMS_JOB or DBMS_SCHEDULER to create an automated schedule to run the job that calls the procedure you have created.
    or assuming that the text file resides or at the local/client machine (example c:\ drive) on a windows xp platform. create a batch file that do a ftp to transfer the text file to the oracle database server and create a schedule job using the windows scheduler. also create a procedure that use the built-in UTL_FILE package to read and load the data to the oracle tables. then create a job that use the DBMS_JOB or DBMS_SCHEDULER to create an automated schedule to run the job that calls the procedure you have created.

  • .How can I add data from one list to other in Jsp Page

    Hi..I have three multiple selection ListBox..I want to add the selected item from 2 list boxes to 3rd list box how can i do that..do i need to write javascript? If possible then suggest me some link where i can get help?
    Thanks
    Regards
    Chintan

    Yep, Javascript.
    Unless you want to post the data to the server and then rewrite the page (ie. jsp/servlets) then you are going to need to use a client side script to modify the page.
    Javascript. You need to get the onClick() event of one list box and get the item that was clicked. then you can rewrite the 3rd list box.
    If possible, try doing a search on google. Or do you want someone to hold your hand.

  • How to save changed data from a input field to the source structure

    Hi,
    I have a small problem with the onChange event with HTML input fields.
    When changing a value of a input field or by creating a new value for a field the OnChange event is called by moving away the mouse pointer....
    get_form_field( 'field_name' ).
    But is it possible to write back the new value in the source field ls_screenstructure_field1 without using the OnInputProcessing?
    I ask because my application´s structures have a lot of fields that should be filled and changed by input fields.
    It´s not comfortable to request every new value with .. = request->get_form_field(... .
    Thanks for helping.
    Cheers,
    André

    you wanted a onchange for a htmlb:inputfield which would also trigger server event. try the following code.
    <htmlb:inputField id            = "test"
                                alignment     = "LEFT"
                                size          = "6"
                                required      = "TRUE"
                                doValidate    = "TRUE"
                                type          = "INTEGER"
                                 />
    <bsp:htmlbEvent id="myid" onClick="myonclick" name="ValueChanged" />
      <script for="test" event=onchange type="text/javascript">
    alert(this.value);
    ValueChanged();
    </SCRIPT>
    if the value in the inputfield is changed it would trigger a alert at the client side and also trigger a server event. now you can caputre the value in oninputprocessing.
    Hope this helps.
    do let us know if you need help in how to capture this value in oninputprocessing.
    Regards
    Raja

Maybe you are looking for

  • Creating a VPN from my remote powerbook to a stand-alone network Hard drive

    I would like to set up a VPN or V secure access from my powerbook to a Network Hard drive so when I travel I can securely access my data over the internet on my hard drive at home, when I have my powerbook with me. I dont want to have to buy another

  • Edited images not showing up in iphoto

    when I edit images in photoshop elements and save them they do not show up in iphoto. I am saving them as tiffs.

  • Error in Fork Step causing issue in generating next work items

    All, We have ECC 6.0 with the following SP: SAP_BASIS     700     0012     SAPKB70012     SAP Basis Component SAP_ABA                     700     0012     SAPKA70012     Cross-Application Component I have this strange issue. In one of my custom workf

  • SRM PO not getting transfer to ECC Backend after SP07 upgradation

    Dear Gurus We are in Classic scenario SRM 7.2 Recently we have upgraded SP07 in R/3 system ECC 6.6. Prior SP 7 upgradation SRM PO created against RFx response were getting transferred to ECC backend in Held status with couple of error messag (which l

  • Location bar does not display in CSH window

    Good morning all, I've got a RH8 project calling a custom CSH window. We want the location bar to appear in the help window so users can navigate forward and backwards among the topics. I've created a new window in RH8 and selceted the Location Bar a