How to get the values retained on clicking the back button in jsp page

Hi All,
I had two jsp's search and results. In the search page when i enter some values in the text fields, the rsults will be displayed for that search criteria. I had a back button in the results page. When i click on this back button i will get back to my search page. I am using the following code for this back button.
<INPUT TYPE="button" VALUE='Back' onClick="javascript:history.go(-1)" class="button">
Now the problem is when i get back to search page using this back button, i am not able to get the values in the search page which i entered, i am getting all blank values. What should i change to get these values back in the search page. Should i maintain any sessions for this?

You have no control at all over the back button process. To the server, it's indistinguishable from the user simply tying the URL of your search page. So, you need to store this data server side*.
When your search page is submitted and processed, store the values you received for each of the fields into the user's session. Then, when the search page is generated, check the session for these values, and for any values that are not null, put their values into the html as the default values for the textboxes and controls you are using. This lets you handle the whole matter on the server's side.
*barring convoluted, unportable, black-magic javascript trickery which you should definitely avoid                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to get current view name on clicking device back button?

    Hi,
    iam wriing a function for handling device back button(in android) press in my app.controller.js .How to get current viewname when clicking device back button.
    code samples will be helpful.
    my app.controller.js looks like below
    sap.ui.controller("com.opensap.App", {
      onInit : function() {
      document.addEventListener("deviceready", onDeviceReady, false);
      onBeforeShow : function(evt) {
      navButtonTap : function(evt) { 
    function onBackKeyDown(){
      //alert("hai");
      //sap.ui.getCore().byId("SalesDetail").app.backToPage("ProductList");
      //sap.ui.getCore().byId("ProductList").app.backToPage("Dashboard");
      //sap.ui.getCore().byId("SupplierDetail").app.backToPage("Dashboard");
    function onDeviceReady(){
       document.addEventListener("backbutton", onBackKeyDown, false);

    I somehow managed to find the solution
    function onBackKeyDown(){
      var app = sap.ui.getCore().byId("LoginDetail").app;
      app.back();

  • BDC - How to ignore skipped screens when user click on back button

    Hello all,
    I am working on a module pool program. From this custom transaction I am calling a standard SAP screen using BAC call transaction. I am calling this screen by skipping 2-3 screens and user can directly see the 3 screen on an event on my custom transaction.
    Now my issue is whenever the user want to back, he clicks on back button then user have to back from all the screens that I skipped.
    Is this any way by which if user click on back then he can directly go to my custom transaction.
    Please suggest.
    FYI..
    I am calling IA06 - Inspection characterstics screen from my custom screen using BDC.
    Thanks,
    Sanket Sethi

    Hi Jovito,
    I also think the same that it's not possible. Now my issue is how to get my requirement.
    FYI..
    To open Classification screen directly we have a function module CLFM_OBJECT_CLASSIFICATION. But if I want to open IA06
    Inspection characterstics screen we don't have any FM or API to do the same.
    So how will I get my requirement done. That why I use the BDC call transaction to open IA06 Insp. characterstics screen but here I am facing this Back issue.
    Please advice if there is any suggestion.

  • Issue of data getting wiped out when user clicks on back button..

    Hello Gurus,
    I have a selection program which displays ALV on execution. Now I have programmed the "Back" Button of standard toolbar so that when comeone clicks on it, it should leave to selection screen.
    WHEN 'TBACK'.
          LEAVE TO TRANSACTION SY-TCODE.
    But when I do that, the values entered by user during execution of selection screen wipes out and all the selection fields become empty. How can I make sure that when sure clicks on 'Back' button, the selectiuon screen is presented but with values in which user put during execution.
    Regards,
    Rajesh.

    Hi Rajesh ,
    Leave to transaction sy-tcode is as as good as call transaction...so basically using this statement will start the transaction afresh..and give a new selection screen....
    Better option would be to leave to screen 0 (preferaby used for a report )which will take you back to the previous screen processed or leave to screen XXXX for a particular screen( in case of a module pool )
    Hope it helps
    Regards
    Byju

  • How to get the value retruned by java script function into my jsp page

    Hai all,
    I had a particular java script function which returns a date.
    function getDate() {
         var sDate;
    // This code executes when the user clicks on a day in the calendar.
    if ("TD" == event.srcElement.tagName)
    // Test whether day is valid.
    if ("" != event.srcElement.innerText)
    //alert(event.srcElement.innerText);
    sDate = document.all.year.value + "-" + document.all.month.value + "-" + event.srcElement.innerText;
    document.all.ret.value = sDate;
    var mahi=window.open("configurexml.jsp?xyz=document.all.ret.value")
    return sDate;}
    Now i want to display this particular date in my jsp page. can anyone tell me the correct approach or a sample code to diaplay this date in my jsp page.
    <%@ page language="java"
    import="javax.xml.parsers.*,java.io.*,org.w3c.dom.*"%><%@ page import="java.util.*" %>
    !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html> <head> <title>Configuring Xml File</title>
    <SCRIPT LANGUAGE="JavaScript" SRC="xyz.js"> </SCRIPT>
    body bgcolor="#d0d0d0" onClick= "return getDate()" >
    <form name="f1">
    <b>20 october 2006 </b>
    Here where i am printing the date i had to get the value from the js function. how to do that. plz help me....

    Are you talking about server-side java code (servlets/jsp) or client side (applet)? Given we are in the JSP forum I'll assume we're talking server side.
    If so, you are making a common but fundamental mistake. JavaScript executes on the client, not on the server. If you want client data on the server it has to get there somehow. The simplest way to do this in JSP land is via HTTP. So... have your JavaScript code call a JSP (or servlet) and pass the value you want as a URL parameter. Of course this will also change the browser location, so if you don't want this to happen use a frame or iframe to capture your HTTP request.
    For example:
    Javascript....
    function someFunction() {
    return 1;
    var value = someFunction();
    location.href="somejsp.jsp?value=" + value;

  • How to call custom BSP application on click of BACK button for SC in EBP.

    Hi All,
    We are implementing OCI using custom BSP applications.In EBP SC screen ,in step1 (Select Goods/Services), the links for these BSP applications are displayed.
    The user can create a shopping cart using these applications , after the items are transfered from BSP to SC on standard  EBP screen , in step2
    there are four buttons ,
    1)Refresh
    2)Check
    3)Back
    4)Continue.
    We need to call one of our custom BSP applications on click of  this BACK button
    How can i acchieve the same?
    Do i need to make changes in the standard ITS application or thers some other way?
    Thanks,
    Anubhav.
    Edited by: Anubhav Jain on Jul 1, 2008 7:24 AM

    To call a wd abap application from BSP use the method CL_WD_UTILITIES=>CONSTRUCT_WD_URL then just create a link in bsp with the url returned like this:
    <a href="url">Link</a>
    To pass data from wd abap to bsp or vice versa that a look at this blog: /people/koen.labie2/blog/2006/11/29/eating-cookies-with-webdynpro-and-bsp
    regards,
    Fabio Louzada Saito

  • How to save data in html format while user click a save button in jsp page

    Hi All,
    I have the following requirement
    If user click on the Save Button it should display a window which allows the user to select the directory and the data is stored in the Internet Explorer Format.
    Could please anybody suggest me how to impletment the above requirment in jsp page.
    It's very urgent. Please replay ASAP.
    Thanks
    Rajeshwari

    Analyzing ur ques ...
    If user click on the Save Button it should display a window which allows the user to select the directory and the data is stored in the Internet Explorer Format.hmmm..
    There is no html object type which supports directory selection for download. There is only an input type="file" which however is related to an upload scenario.
    By downloading the file using output stream u can achieve what you want.
    You simply need to do the following things ..
    a) Write to an output stream
    b) Set the content type to "text/html" for your response
    Example ....
    response.setContentType("text/html");
    response.setHeader("Content-disposition",
    "attachment; filename" +
    "Example.html" );
    javax.servlet.ServletOutputStream stream = res.getOutputStream();
    StringBuffer text = new StringBuffer(1024);
    text.append("some text . . . ");
    text.append("more text . . . ");
    stream.write(data);
    stream.close();

  • How to get these values?

    This sample output of trcsess shows the consolidation of traces for a particular
    session. In the following example the session index and serial number equals 21.2371.
    trcsess session=21.2371My question is: what are session index and serial number here? How to get these values?

    As per the tuning doc:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm#i20110
    You get these values from the V$SESSION view.
    Session Index = SID
    Serial number = SERIAL#

  • Going back to previous screen by clicking on back button in IE

    Hi All,
    We have an webdynpro application where in there are many screens and the user can move from one screen to the other by click of buttons.
    I have a requirement by which the end user should be able to come back to the previous screen by clicking on "Back" button of the Internet explorer rather than from clicking of button in the application.
    Can we retrieve the event handler of the back action of IE.
    Is this scenario possible.If yes,the please let me know the solution.
    Thanks and Regards,
    Pradeep

    Hi PRADEEP !!!
                             What you are requesting might work in some applications, but it is generally not recommended to use the explorer back button to go back. Its better to use the WD UI Button to go back.
    I hope this helps, if you need some thing else, please revert back, I'll be happy to help you.
    Cheers!!!
    Umang

  • How to get maximal value from the data/class for show in Map legend

    I make WAD report that using Map Web Item.
    I devide to four (4) classes for legend (Generate_Breaks).
    I want to change default value for the class by javascript and for this,
    I need to get maximal value from the class.
    How to get maximal value from the data/class.
    please give me solution for my problem.
    Many Thx
    Eddy Utomo

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

  • How to get default values while using the transaction "BP"

    Hi Group,
    I have a query on how to get default values while using the transaction <b>BP</b>?
    The thing is:
    when I enter into the transaction "BP", I need to see some default values to some of the input fields in the screen.
    how can I achieve this?
    So please kindly let me know the procedure to achieve this.
    Thanks & Regards,
    Vishnu.

    Hi,
    The events of BDT can be used to default some fields on creating a partner.
    For this create a function module for ISDAT. attach that event in BUS7.
    In the ISDAT funtion modulethe following code should be used.
    For example to set the nationality:
    I_BUSDEFAULT-NATIO = 'DE.
    CALL FUNCTION 'BUP_BUPA_FIELDVALUES_SET'
    EXPORTING
    i_busdefault = I_BUSDEFAULT
    Regards, Smita.

  • UDF: how to get a value in the previous record when lopping over records?

    Hello
    I have this challenge:
    Source message:
    <row>
      <ID>111</ID>
      <Score>200</Score>
      <Date>2010-01-01</Date>
    </row>
    <row>
      <ID>111</ID>
      <Score>230</Score>
      <Date>2010-01-02</Date>
    </row>
    <row>
      <ID>112</ID>
      <Score>230</Score>
      <Date>2010-01-03</Date>
    </row>
    etc...
    Now the case is, that IF the value of ID of the current record (row) is equal to the value of the ID of the previous record AND the Score value of the current record is bigger than the Score value of the previous record THEN a record in the target message must be created with these values:
    Target Message:
    <row>
      <ID_target> value of source ID </ID_target>
      <Score_yesterday> Score value of previous record (day) </Score_yesterday>
      <Score_current_date> Score value of current record </Score_current_date>
      <Date_current> Date of current record  </Date_current>
    </row>
    I am thinking of using GlobalContainer to store the previous values but am note sure how to maintain these previous values. In addition, I am thinking about using a UDF on the target row record, which will just create the row, if conditions are met (result.addValue("");) and then just make a simple mapping of the ID_target, Score_current_date and Date_current fields and make an other UDF for the Score_yesterday field where I get the Score for the previous record using the GlobalContainer value, that I stored in the other UDF.
    BUT:
    Should I use "All values of context" or "All values of Queues" in the UDF used on the row record and how do I make sure, that the Score_yesterday global container value is maintained correctly? I am planning of setting it in the UDF used on the Target row record but will it then be in sync with the consuming UDF of the Score_yesterday field?
    Java code to go into the UDF would be very much appreciated
    Mikael

    int tmp1;
    int tmp2;
    int len = ID.length;
    for(int i =0;i< len;i++)
         if( i!= len-1)
             tmp1 = Integer.parseInt(Score<i>);
             tmp2 = Integer.parseInt(Score[i+1]);
                   if(tmp2 >tmp1)
                     if (TARGET[0].equals("ROW"))
                              result.addValue("");
                          else if (TARGET[0].equals("ID_TARGET"))
                              result.addValue(ID[0]);
                         else if (TARGET[0].equals("SCORE_YDAY"))
                              result.addValue(Score<i>);
                         else if (TARGET[0].equals("SCORE_CDAY"))
                             result.addValue(Score[i+1]);
                         else
                             result.addValue(DT[i+1]);
    I got the following results for the set of data that you provided.
    Target-XML
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_TestingTGT xmlns:ns0="http://monsanto.com/CIC">
       <Row>
          <ID_TARGET>571515198310502207</ID_TARGET>
          <SCORE_YDAY>1000</SCORE_YDAY>
          <SCORE_CDAY>1010</SCORE_CDAY>
          <CURRENT_DATE>2010-03-02 00:00</CURRENT_DATE>
       </Row>
       <Row>
          <ID_TARGET>571515198310502207</ID_TARGET>
          <SCORE_YDAY>1000</SCORE_YDAY>
          <SCORE_CDAY>1050</SCORE_CDAY>
          <CURRENT_DATE>2010-03-04 00:00</CURRENT_DATE>
       </Row>
       <Row>
          <ID_TARGET>571515198310502207</ID_TARGET>
          <SCORE_YDAY>1050</SCORE_YDAY>
          <SCORE_CDAY>1080</SCORE_CDAY>
          <CURRENT_DATE>2010-03-05 00:00</CURRENT_DATE>
       </Row>
       <Row>
          <ID_TARGET>571515198310502108</ID_TARGET>
          <SCORE_YDAY>2000</SCORE_YDAY>
          <SCORE_CDAY>2040</SCORE_CDAY>
          <CURRENT_DATE>2010-03-03 05:00</CURRENT_DATE>
       </Row>
       <Row>
          <ID_TARGET>571515198310502108</ID_TARGET>
          <SCORE_YDAY>2000</SCORE_YDAY>
          <SCORE_CDAY>2040</SCORE_CDAY>
          <CURRENT_DATE>2010-03-05 05:00</CURRENT_DATE>
       </Row>
       <Row>
          <ID_TARGET>571515198310302203</ID_TARGET>
          <SCORE_YDAY>3000</SCORE_YDAY>
          <SCORE_CDAY>3020</SCORE_CDAY>
          <CURRENT_DATE>2010-03-05 00:00</CURRENT_DATE>
       </Row>
    </ns0:MT_TestingTGT>

  • How to get a form to appear on the same page when a button is clicked?

    Hi,
    I have a report on a page with a create button. When a user clicks the create button, a form should appear on another region in the same page....how do i go about doing this?
    I know how to do this if the form is on a different page, but i'd like the form to appear on the same page as the report and only when the button is clicked.
    Thanks.

    Hi,
    I did the following, but it didnt work....
    1) Created a hidden item on the page, and in the Default Value field, I set the value to N.
    2) Created a button in the report with the following values under "Optional URL Redirect":
    Target is a: Page in this application
    Page: 4
    Set these items: P1_SHOW_FORM
    With these values: Y
    3) Created a form of HTML text type with the following values under "Conditional Display":
    Condition Type: Request=Expression 1
    Expression 1: P1_SHOW_FORM='Y'
    What have I done wrong or have i missed something?
    Thanks.

  • Can anyone explain to how to get rid off restore session on the mozilla firefox it keeps coming up every time i click on mozilla firefox it comes up restore session why is this it is driving me nuts

    can anyone explain to me how to get rid off restore session on the mozilla firefox it keeps coming up every time i click on mozilla firefox it comes up restore session why is this i want to get rid of it it is driving me nuts

    What do you have checked in Firefox Preferences>General?
    Ciao.

  • How many times do you have to click the sleep/wake button to get the light brighter? (on iPod touch)

    How many times do you have to click the sleep/wake button (top button) to get the light/screen brighter? (on iPod touch)

    That is not haow you change brigntness. Go to Settings>Brightness to adjust screen brightness.

Maybe you are looking for

  • LCD Panel not supported (acpi brightness)

    Hi all, This is my first post, Hello!  I have used several distros but this is my first time using Arch. I have a dell d420 (dual core / intel graphics).  I have installed Arch with lxde / compiz. Things have been going pretty well so far, I really l

  • IPad 5.0 and Pages 1.7; Maverick and Pages 5.0

    Recently, I upgraded to Maverick and the latest version of Pages.   I have been using my iPad I with iOS 5.X., and saving documents to my iCloud.  This allows me to work on documents either on my desktop or iPad.  This is no longer true.  Now, docume

  • Invoice Carryforward Error

    I am an SAP Superuser and new to this website. At year end, Accounts Payable Invoices were carried forward to the following fiscal year in error. Now the financial postings do not agree to the budget postings at year end or the new fiscal year. Typic

  • CS5 - Export .jpg specify (or change) Image Size

    Ok we have currently setup 2 templates one for print cards and one for web cards. What we would like to do since both cards are identical except the size of the card, is have just one template. Both of these are linked to .Ai vector graphics. Problem

  • Saving pdf-forms

    Hello all! Does anybody know how to solve the following problem. We are new to iMac, so maybe it's very easy to do but we just do know know how and are pushing the wrong buttons Anyway. We have a pdf-form filled out. We want to open it, modify it and