Automatically Assign Form Fields To Session

I have a couple of forms and I want to be able to move backwards and forwards between them while keeping the information there. The following is one of the forms:
<%
if ((String) session.getAttribute("FirstName") == null || request.getParameter("FirstName") != session.getAttribute("FirstName"))
  session.setAttribute("FirstName", request.getParameter("FirstName"));
if ((String) session.getAttribute("MiddleInitial") == null || request.getParameter("MiddleInitial") != session.getAttribute("MiddleInitial"))
  session.setAttribute("MiddleInitial", request.getParameter("MiddleInitial"));
if ((String) session.getAttribute("LastName") == null || request.getParameter("LastName") != session.getAttribute("LastName"))
  session.setAttribute("LastName", request.getParameter("LastName"));
if ((String) session.getAttribute("PhoneNumber") == null || request.getParameter("PhoneNumber") != session.getAttribute("PhoneNumber"))
  session.setAttribute("PhoneNumber", request.getParameter("PhoneNumber"));
if ((String) session.getAttribute("Site") == null || request.getParameter("Site") != session.getAttribute("Site"))
  session.setAttribute("Site", request.getParameter("Site"));
if ((String) session.getAttribute("Department") == null || request.getParameter("Department") != session.getAttribute("Department"))
  session.setAttribute("Department", request.getParameter("Department"));
if ((String) session.getAttribute("Position") == null || request.getParameter("Position") != session.getAttribute("Position"))
  session.setAttribute("Position", request.getParameter("Position"));
String sFirstName = (String) session.getAttribute("FirstName");
String sMiddleInitial = (String) session.getAttribute("MiddleInitial");
String sLastName = (String) session.getAttribute("LastName");
String sPhoneNumber = (String) session.getAttribute("PhoneNumber");
String sSite = (String) session.getAttribute("Site");
String sDepartment =(String) session.getAttribute("Department");
String sPosition = (String) session.getAttribute("Position");
if (sFirstName == null)
  sFirstName = "";
if (sMiddleInitial == null)
  sMiddleInitial = "";
if (sLastName == null)
  sLastName = "";
if (sPhoneNumber == null)
  sPhoneNumber = "";
if (sSite == null)
  sSite = "";
if (sDepartment == null)
  sDepartment = "";
if (sPosition == null)
  sPosition = "";
%>
<form name="frmUserDetails" action="UserDetails.jsp" method="POST">
  <table class="BodyPosition" cellpadding="0" width="400" border="0" cellspacing="2">
    <tr>
      <td class="HeaderRow" colspan="2" width="591">
        <p class="Normal">USER DETAILS</p>
      </td>
    </tr>
    <tr>
      <td width="100">
        <p class="Normal">First Name:</p>
      </td>
      <td width="300">
        <p class="Normal">
          <input type="text" class="TextBox20" name="FirstName" value="<%= sFirstName %>" maxlength="100" size="20">
        </p>
      </td>
    </tr>
    <tr>
      <td>
        <p class="Normal">Middle Initial:</p>
      </td>
      <td>
        <p class="Normal">
          <input type="text" class="TextBox1" name="MiddleInitial" value="<%= sMiddleInitial %>" maxlength="1" size="1">
        </p>
      </td>
    </tr>
    <tr>
      <td>
        <p class="Normal">Last Name:</p>
      </td>
      <td>
        <p class="Normal">
          <input type="text" class="TextBox20" name="LastName" value="<%= sLastName %>" maxlength="100" size="20">
        </p>
      </td>
    </tr>
    <tr>
      <td>
        <p class="Normal">Phone Number:</p>
      </td>
      <td>
        <p class="Normal">
          <input type="text" class="TextBox20" name="PhoneNumber" value="<%= sPhoneNumber %>" maxlength="20" size="20">
        </p>
      </td>
    </tr>
    <tr>
      <td>
        <p class="Normal">Site:</p>
      </td>
      <td>
        <p class="Normal">
          <input type="text" class="TextBox20" name="Site" value="<%= sSite %>" maxlength="10" size="10">
        </p>
      </td>
    </tr>
    <tr>
      <td>
        <p class="Normal">Department:</p>
      </td>
      <td>
        <p class="Normal">
          <input type="text" class="textBox20" name="Department" value="<%= sDepartment %>" maxlength="200" size="20">
        </p>
      </td>
    </tr>
    <tr>
      <td>
        <p class="Normal">Position:</p>
      </td>
      <td>
        <p class="Normal">
          <input type="text" class="TextBox20" name="Position" value="<%= sPosition %>" maxlength="200" size="20">
        </p>
      </td>
    </tr>
  </table>
<input type="Submit">
</form>Now I was wondering if there would be a way to automate the code up the top:
if ((String) session.getAttribute("FirstName") == null || request.getParameter("FirstName") != session.getAttribute("FirstName"))
  session.setAttribute("FirstName", request.getParameter("FirstName"));
if ((String) session.getAttribute("MiddleInitial") == null || request.getParameter("MiddleInitial") != session.getAttribute("MiddleInitial"))
  session.setAttribute("MiddleInitial", request.getParameter("MiddleInitial"));
if ((String) session.getAttribute("LastName") == null || request.getParameter("LastName") != session.getAttribute("LastName"))
  session.setAttribute("LastName", request.getParameter("LastName"));
if ((String) session.getAttribute("PhoneNumber") == null || request.getParameter("PhoneNumber") != session.getAttribute("PhoneNumber"))
  session.setAttribute("PhoneNumber", request.getParameter("PhoneNumber"));
if ((String) session.getAttribute("Site") == null || request.getParameter("Site") != session.getAttribute("Site"))
  session.setAttribute("Site", request.getParameter("Site"));
if ((String) session.getAttribute("Department") == null || request.getParameter("Department") != session.getAttribute("Department"))
  session.setAttribute("Department", request.getParameter("Department"));
if ((String) session.getAttribute("Position") == null || request.getParameter("Position") != session.getAttribute("Position"))
  session.setAttribute("Position", request.getParameter("Position"));
}So it is done automatically. The I thought this could be done is by getting all the fields on the form and putting them in an array and then doing a loop. But I don't know how I can get all the fields off the form. I am guessing you can get the fields from the query string but I don't know how to get the right info out of it.
Could someone help plz.

not yet, there seems to be an error, trying to figure it out.
java.lang.IllegalArgumentException
     at javax.servlet.http.HttpUtils.parseQueryString(HttpUtils.java:138)
     at org.apache.jsp.Loop$jsp._jspService(Loop$jsp.java:55)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
     at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
     at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
     at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:371)
     at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:424)
     at java.lang.Thread.run(Thread.java:536)

Similar Messages

  • Assign form field value

    Gurus:
    Given a value in form field one, I want to assign a value to form field two (same form). How can I accomplish this?
    Thanks in advance!
    kc

    Ken,
    You can set the the value on the server side from any event hadlers by calling p_session.set_value() function. For an example please see Portal FAQ: http://otn.oracle.com/products/iportal/htdocs/portal_faq.htm
    Thanks,
    Dmitry

  • HCM Processes & Forms - automatically UPPERCASE form fields

    Hi gurus!
    I have a requirement to do an automatically translation to uppercase form field values. Is there any 'standard' solution to do something like that? If no, should to do something in backend?
    KR

    You could create a generic service which reads all the form fields and convert them to upper case
    using TRANSLATE command.
    Another option is to enhance the based feeder class cl_hrasr00_fpm_feeder.
    Hope this helps.
    Regards.

  • Automatically Updated Form Fields

    How can I set a field in a PDF form to automatically update with the entry in another field.  I need to do this for both free form and numerically formatted fields.
    Thanks

    Can you be a little more specific about what you mean by 'automatically update with the entry in another field'? That could be interpreted different ways, each requiring a different solution in the PDF. Do you want the fields to share the same value? Do you need a calculated value? Do you need to set the value in field A using a matching value from the entered value in field B?

  • Assign form fields to object members.

    Hello all,
    I have the following code to assign values from object memebes to Swing Combo boxes. How do assign the values of JComboBoxes back to birdata members withou going through each Combo box individually or without wrting event for each combo boxes? I want to put it in a loop so it takes care of all combo boxes.
    Thanks for your reply.
    -Hitesh
    private javax.swing.JComboBox jComboBoxfieldsarray[] = new javax.swing.JComboBox[3];
    private String comboboxfieldstrarray[] = new String[3];
    bir birdata = new birdata();
    jComboBoxfieldsarray[0] =jComboBox_surf_rtg_cd;
    jComboBoxfieldsarray[1] =jComboBox_expjt_rtg_cd;
    jComboBoxfieldsarray[2] =jComboBox_othjt_rtg_cd;
    comboboxfieldstrarray[0] =birdata.surf_rtg_cd;
    comboboxfieldstrarray[1] =birdata.expjt_rtg_cd;
    comboboxfieldstrarray[2] =birdata.othjt_rtg_cd;
    //Assign values of birdata members to JComboBoxes
    for ( int i = 0; i< jComboBoxfieldsarray.length; i++ ){
    setjCombobox( jComboBoxfieldsarray, comboboxfieldstrarray[i]);

    You're assuming that each event listener can only handle one combo box, which is the case if you're using anonymous inner classes
    combobox.addItemListener(new ItemListener()
       public void itemStateChanged(...) yada, yada, yada
    }But there is no reason why you can't create a concrete inner class whose constructor would take in an index to your array and store it to a private data member of the inner class. When the listener method is called, the source of the event is the combo box, so you can cast it to JComboBox and get the value of the selected item. The index you stored can then be used to save the value selected the way you want to. Then, just...
      combobox.addItemListener(new MyListener(1));

  • Auto-generate form fields from PDF in LiveCycle?

    I have a PDF created with InDesign that is destined to be an interactive PDF form. For previous versions I have imported it into Acrobat and had it generate the fields based on the text columns I layed out in InDesign.
    I wanted to try for more function in my form, so I thought I'd use LiveCycle, but I can't figure out how to get it to automatically create form fields when I first import the PDF. Is this not something that LiveCycle does, or am I just missing something?

    Hi,
    I don't like automatically generated PDFs.
    But sure you can create this with the LCD. The only thing is that the acrobat recognize lines (for example) and place a textobject to this location. The LCD not really.
    Open the LCD
    Then select "New Form".
    Then select "Import PDF".
    Then select "Create"
    Then the software will try to recognize everything..
    My opinion is - THE BEST WAY to create a formular is this to create by myself in the LCD step by step. Then this software has so many possibilities...for really good PDFs.
    Kind regards Mandy

  • Do InDesign table fields convert to form fields for interactive PDFs?

    Does InDesign CC recognize table fields as form fields when creating fillable form PDFs - or do I have to create individual text fields on top of the InDesign table and assign form field text field characteristic in the buttons and forms menu?

    I don't believe InDesign itself will apply any form of automated recognition to table cells...BUT...Acrobat's form field recognition certainly picks up empty table cells and assigns them as text-input fields.
    See this page: http://www.eformsfactory.com/mobile-desktop-forms-with-form-field-recognition-in-adobe-acr obat/

  • Assigning a form field to a variable in XSL in rtf template

    Hi,
    I have this code:
    <?xdoxslt:set_variable($_XDOCTX, 'x', 0)?>
    <?if:_-Basic._Total_Jobs_=''?>0<?end if?>
    <?xdoxslt:set_variable($_XDOCTX, 'x', -Basic_._Total_Jobs_ )?>
    <?xdoxslt:get_variable($_XDOCTX, 'x')?>
    This code is supposed to be initialising a variable and a form field if it's null, and
    then assigning the form field value to the variable. But I am not getting
    any value from the get_variable function.
    Any ideas?
    Thanks,
    - Jenny

    I figured it out. The bind variable substitution works as designed. It was just my head that wasn't working right.

  • How to update session state from form field values without submitting page?

    Hi,
    I am new to Oracle APEX. I am using Oracle Apex 4.2 on Oracle 11g release 2. The problem is that when I am entering data on a form, when I enter a value in one field and move to the next field, how can I use the value of first field in the validation procedure of next field? I know that when we enter data in fields, the session state is not updated with these values until we submit the page... right... but I have seen that if there is a control of List box type, then Apex gives an option "Action When List changes" where we can choose option to update corresponding session state field with the value of list box item, without submitting the page.
    Now my questions is why this option is only available for List box items? why not for other item types like Text box, Check box,... ? can someone please help me with this?
    (the issue with update of session state depending on page submitting, is that we need a complete network round trip from client to server in order for it. However if we can update session state variables without submitting page, then we can avoid this network traffic).
    Any help will be greatly appreciated. Thanks in advance.

    Create a dynamic action on change and run a PL/SQL process there with the following code:
    BEGIN
       NULL;
    END;Page items to submit > your item.
    This will set the session state without submitting the form.
    Further examples here:
    http://apex.oracle.com/pls/apex/f?p=31517:229
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Form fields in Acrobat Prof. 8.1.6 updating automatically

    I have a form I created in Acrobat Prof. 8.1.6. When I fill in one field it automatically fills in the same information in ever field on that line. I don't want it to do that and can't seem to find a way to make it stop. Not all lines are doing this. The top line doesn't do it, just all lines below. I am attaching the file so you can see for yourself what is happening. I want all fields to be independent of each other. Thanks for any help on this.
    I have already unchecked auto complete in preferences and this did not work.

    Go back to your form and look at it closely.
    None of the form fields should have the exact same name.
    if they do whatever is filled in in one will be filled in, all with same name.
    There actually is an advantage in rare occasions, to have that happen. say when you need the exact same information at top of each page in a form. You fill in once and it filled in in every page that needs the information.
    Name       Name      Name  , will have same information
    Name1     Name2     Name3 , will not.

  • Identifying form fields automatically when word doc is imported

    Hi
    I am trying to convert a word document template to a PDF template using Adobe Live Cycle. There are 7 tables in the Word document. I saved the doc as PDF using Word. When i imported the PDF into the Live Cycle Designer, the form fields ( table rows and cells) are not being identified. All are kind of static text.
    However, when i opened the same PDF in Acrobat Pro, i was able to identify the form fields ( using Form > edit fields option).
    Is there something similar available in Live Cycle Designer. Can the LCD identify form fields automatically.
    Appreciate your help.
    Thanks and regards
    Ram

    I don't believe this functionality is built into LiveCycle Designer. However, you can start your form in Acrobat (Acroform) then import the PDF into LiveCycle. Keep in mind this is a one way process.

  • Autopopulating PER_ALL_people_f column fields(related to people DFF) depending on Job title change in assignment form.

    Autopopulating PER_ALL_people_f column fields(related to people DFF) depending on Job title change in assignment form.

    Can you check these -
    http://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CDYQFjAB&url=http%3A%2F%2Foracle.anilpassi.com%2Ff…
    Forms personalization for DFF

  • How to automatically update InfoPath Form fields(Design) when a new Column is created in SharePoint list?

    Hi All , 
    We have a scenario to automatically update the Infopath form(List Form) fields(Field Name and Control) when ever a new Column is created in the SharePoint list. Is it possible to do this? any options or suggestions?
    Thanks and Regards,
    Nandini

    Hi Nandini,
    I am not very sure will this be going to help you. Ideally, it's not so easy to communicate with infopath using object model. But still you can give it a try using below link :
    http://social.msdn.microsoft.com/forums/sharepoint/en-US/00125fdc-2115-47ea-8e8b-1ca9e5942f83/update-infopath-form-field-in-event-receiver
    I think the above solution is trying to update the field. Addition to that you can try creating a field and control.
    Let me know if it helps  !!
    Thanks

  • How to store forms fields into the session ?

    Hi All,
    I have to store forms fields into the session.
    I have four forms (htm forms) in four jsps and there are total 25 fields.
    I am inserting all the fields into the database at once while user submit the last form.
    I want to use session to store forms fields.
    So please anybody tell me how to do that.
    Is the following code correct to store the forms fields into
    the sesstion........
    // creating a session
    HttpSession session=request.getSession(true);
    // retrieving form fields
    String name=request.getParameter("customer_name");
    String business=request.getParameter("business");
    String address=request.getParameter("address");
    and so on....
    // store form fields into the session
    session.setAttribute("name",name);
    session.setAttribute("business",business);
    session.setAttribute("address",address);
    and so on....
    and later on get the value as:
    session.getAttribute("name");
    session.getAttribute("business");
    session.getAttribute("address");
    and so on....
    OR
    is there another way to store form fields into the session.
    Please guide and reply with coding.....
    Please answer and help.
    Thanks
    Amitindia

    I don't mean to be an *** but I have no desire to help someone so unwilling to think >>and do. Go through some of these tutorial, do the examples in each and you will be far >>better equipped to ask questions:
    http://www.google.co.za/search?hl=en&q=%2Bjsp+%2Bjavabean+%2Btutorial&b >>tnG=Google+Search&meta=
    I was just asking that if I use the following
    <jsp:useBean id="cart" scope="session" class="session.Carts" />
    <jsp:setProperty name="cart" property="address" value="myaddress" />
    </jsp:useBean>then will I be able to acheive my aim as I have to store form fields into the session and later retreive while user submit the last form.
    Please read my question that I have posted.
    Am I using the right way................or which is the best way to store form fields into the session and later retrieve them.
    please reply
    Thanks
    Amitindia

  • Automatic assignment of hierarchy field in the main table

    Hi,
    We are upgrading from SRM-MDM catalog 2.0 to SRM-MDM catalog 3.0 sp07 patch 10.
    In the main table, we have the standard field Hierarchy, that is a lookup on table Hierarchy.
    In order to value this field, we have a specific field in the Main table, the UNSPSC code, that is a lookup on a specific reference table. This reference table makes the link between UNSPSC codes and nodes of the Hierarchy table.
    After importing a new record that contains the UNSPSC code, we want to automatically assign a value to the hierarchy field in the Main table by the assignment's expression "[main table]UNSPSC code. [specific table]name of hierarchy. [Hierarchy table]name of hierarchy".
    When executing this assignment, we get the error "Assignment operation failed: A runtime error occurred while evaluating an assignment, validation or calculated field".
    Do you know if this kind of assignment is possible (it worked in MDM 5.5 but not anymore in 7.1) ? Or if there is a workaround ?
    Thanks for your kind help.
    Catherine

    Hi Mandeep,
    Thanks for your answer.
    But, I do not want to assign a specific value to the Hierarchy field in the Main table. I want to determine it via a specific table.
    Here is a sample of our data model to try to explain :
    Main table :
    item reference [Display field]
    hierarchy --- lookup on Hierarchy table
    UNSPSC code --- lookup on Specific reference table
    Hierarchy table :
    hierarchy name [Display field]
    hierarchy code
    Specific reference table, type flat :
    UNSPSC code [Display field]
    hierarchy name --- lookup on Hierarchy table
    After import, in the Main table, item reference and UNSPSC code are valued.
    In order to value the hierarchy field in the Main table, we would like to use the specific reference table :
    [Main table]UNSPSC code >>> [Specific reference table]hierarchy name >>> [Hierarchy]hierarchy name.
    This assignment works if the assignment field is a plain text field but not if it is the Hierarchy field of the Main table, which is on lookup on the Hierarchy table.
    Thanks for your help !
    Best regards,
    Catherine

Maybe you are looking for

  • Travel Adapter and iPod USB Power Adapter

    I know this is going to sound like a stupid question but this is all new to me so please bear with me I just bought an iPod video, a World Travel Adapter kit and the Power Duo kit - which contains a power block wall charger, USB mini cable, and car c

  • Issue with a user mailbox.

    We're running exchange 2010 SP2 RU8. I have one particular user were I'm getting the following error: Cannot open mailbox /o=Org/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=EXSRV01/cn=Microsoft System Attendant.

  • Why can't I get FaceTime to work on ipad2

    I've tried to do the 8.8.8.8 on the settings, I have everything in working order. I never used FaceTime prior to now even though my iPad is over a year old. I have always used my iPhone. I don't understand why it won't let me  get it going. Any sugge

  • 8500A all-in-one coming up with blank scan using ADF

    8500A all-in-one...getting message "ADF misfeed--reload"-etc--feeder is working fine, but light doesn't stay on while document is feeding (sometimes comes on for a second or less at beginning)--end up with blank document.  On occasion (minority of ti

  • Security tables to find T-code, object, field and value combination..

    Hello, I have requirement where I have to scan a role in SAP which has certain combination of T-Code, Object, Field and value. For example: I need to find all roles in SAP which has following combination of T-Code, Object, Field and Value: T-CODE....