2 Events on single button click in JSP.

Hello!
I want your help in the following topic.
I want to load 1 html-report page as well as i want to open 1 window on the single(same) button click, on the JSP page & as soon as the html-report page gets loaded , the window should get closed.
I don't know how to do this. If anyone knows please help me in this.
Thank You.

I don't see why you want to open a second page, then close the first one.
However each page must be generated by a separate request from the browser to the server so the essential stuff all has to be done on the client side with JavaScript. JSPs are nothing to do with it. JSPs are intended to do one thing - generate HTML and the JSP has done it's job before the page arrives on your browser.
To open a popup window your Javascript used Window.open(url, windowName).
What you'll get with be a pop-up window, so check your browser settings (which may block pop-up windows). This might be a reason to re-think your design.

Similar Messages

  • I'm not able to get to the OnInputProcessing event from a button click

    I have a tableview and I added a button and I have put the code in the event OnInputProcessing. But when I click the button, it does not get to the event. Do you know what the problem might be?
    Please help
    Here's the complete code:
    ==============================
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <%@extension name = "bsp" prefix="bsp" %>
    <% if mrept = 'X'.%>
    <htmlb:content design="classicdesign2002design2003" >
      <htmlb:page title = "Manager's Report ">
      <htmlb:form>
          <%-- TableView with columns description table --%>
          <htmlb:tableView id              = "tvX"
                           headerText      = "Manager's Report"
                           headerVisible   = "true"
                           design          = "alternating"
                           visibleRowCount = "30"
                           fillUpEmptyRows = "true"
                           onHeaderClick   = "MyEventHeaderClick"
                           onRowSelection  = "MyEventRowSelection"
                           keyColumn       = "contract"
                           table           = "<%= ZVMGR_MREPT %>"
                           iterator        = "<%= tv_iterator %>" >
          <htmlb:tableViewColumns>
              <htmlb:tableViewColumn    columnName       = "manager"
                                        wrapping         = "true"
                                        title            = "Manager" />
              <htmlb:tableViewColumn    columnName       = "sales_rep"
                                        wrapping         = "true"
                                        title            = "Sales Rep" />
              <htmlb:tableViewColumn    columnName       = "kunnr"
                                        wrapping         = "true"
                                        title            = "Sold To" />
              <htmlb:tableViewColumn    columnName       = "zzmassn"
                                        wrapping         = "true"
                                        title            = "Action" />
              <htmlb:tableViewColumn    columnName       = "action_date"
                                        wrapping         = "true"
                                        title            = "Compliance Review Date" />
              <htmlb:tableViewColumn    columnName       = "vtext"
                                        wrapping         = "true"
                                        title            = "Prod Line" />
              <htmlb:tableViewColumn    columnName       = "name1"
                                        wrapping         = "true"
                                        title            = "Name" />
              <htmlb:tableViewColumn    columnName       = "ort01"
                                        wrapping         = "true"
                                        title            = "City" />
              <htmlb:tableViewColumn    columnName       = "regio"
                                        wrapping         = "true"
                                        title            = "State" />
              <htmlb:tableViewColumn    columnName       = "period"
                                        wrapping         = "true"
                                        title            = "Compliance Review Period" />
              <htmlb:tableViewColumn    columnName       = "c_or_nc"
                                        wrapping         = "true"
                                        title            = "Status" />
              <htmlb:tableViewColumn    columnName       = "shortfall"
                                        wrapping         = "true"
                                        title            = "Shortfall Total" />
              <htmlb:tableViewColumn    columnName       = "close_date"
                                        wrapping         = "true"
                                        title            = "Action Date" />
              <htmlb:tableViewColumn    columnName       = "rewrt"
                                        wrapping         = "true"
                                        title            = "Action $" />
              <htmlb:tableViewColumn    columnName       = "zrvtid"
                                        wrapping         = "true"
                                        title            = "Contract" />
             </htmlb:tableViewColumns>
             </htmlb:tableView>
               <htmlb:button id = "btnxl" design = "emphasized" text = "Excel"
                onClientClick = "OnInputProcessing()" tooltip = "Download to Excel" />
           <p>
        <input type=submit name="onInputProcessing(Submit)"  value="Excel">
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    <%else.%>
    <htmlb:content design="classicdesign2002design2003" >
      <htmlb:page title = "Sales Rep's Report ">
        <htmlb:form>
          <%-- TableView with columns description table --%>
          <htmlb:tableView id              = "tvX"
                           headerText      = "Sales Rep's Report"
                           headerVisible   = "true"
                           design          = "alternating"
                           visibleRowCount = "30"
                           fillUpEmptyRows = "true"
                           onHeaderClick   = "MyEventHeaderClick"
                           onRowSelection  = "MyEventRowSelection"
                           keyColumn       = "contract"
                           table           = "<%= ZVMGR_SREPT %>"
                           iterator        = "<%= tv_iterator %>" >
          <htmlb:tableViewColumns>
              <htmlb:tableViewColumn    columnName       = "sales_rep"
                                        wrapping         = "true"
                                        title            = "Sales Rep" />
              <htmlb:tableViewColumn    columnName       = "kunnr"
                                        wrapping         = "true"
                                        title            = "Sold To" />
              <htmlb:tableViewColumn    columnName       = "zzmassn"
                                        wrapping         = "true"
                                        title            = "Action" />
              <htmlb:tableViewColumn    columnName       = "action_date"
                                        wrapping         = "true"
                                        title            = "Compliance Review Date" />
              <htmlb:tableViewColumn    columnName       = "vtext"
                                        wrapping         = "true"
                                        title            = "Prod Line" />
              <htmlb:tableViewColumn    columnName       = "name1"
                                        wrapping         = "true"
                                        title            = "Name" />
              <htmlb:tableViewColumn    columnName       = "ort01"
                                        wrapping         = "true"
                                        title            = "City" />
              <htmlb:tableViewColumn    columnName       = "regio"
                                        wrapping         = "true"
                                        title            = "State" />
              <htmlb:tableViewColumn    columnName       = "period"
                                        wrapping         = "true"
                                        title            = "Compliance Review Period" />
              <htmlb:tableViewColumn    columnName       = "c_or_nc"
                                        wrapping         = "true"
                                        title            = "Status" />
              <htmlb:tableViewColumn    columnName       = "shortfall"
                                        wrapping         = "true"
                                        title            = "Shortfall Total" />
              <htmlb:tableViewColumn    columnName       = "close_date"
                                        wrapping         = "true"
                                        title            = "Action Date" />
              <htmlb:tableViewColumn    columnName       = "rewrt"
                                        wrapping         = "true"
                                        title            = "Action $" />
              <htmlb:tableViewColumn    columnName       = "zrvtid"
                                        wrapping         = "true"
                                        title            = "Contract" />
             </htmlb:tableViewColumns>
             </htmlb:tableView>
               <htmlb:button id = "btnxl" design = "emphasized" text = "Excel"
                onClientClick = "OnInputProcessing()" tooltip = "Download to Excel" />
           <p>
        <input type=submit name="onInputProcessing(Submit)"  value="Excel">
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    <%endif.%>

    Hey Samuel,
    You have not defined the name of the event.
    Your button tag should be defined as follows:
    <b><htmlb:button id = "btn_ShowProductStructure"
    text = "Show Product Structure"
    design = "EMPHASIZED"
    onClick = "onInputProcessing(<i>btn_ShowProductStructure</i>)"
    tooltip = "Click here to open Product Structure.."
    /></b>
    In attribute: onClick = "onInputProcessing(btn_ShowProductStructure)" replace <b><i>btn_ShowProductStructure</i></b> by the name of the event that you want to define.
    Then onInputProcessing Page write the following code:
    <b>IF EVENT->NAME = 'button' AND EVENT->EVENT_TYPE ='click'.
       CASE EVENT->ID.
         WHEN <i>'btn_ShowProductStructure'</i>.
    <your logic comes here>
    ENDCASE.</b>
    Regards,
    Reema.
    Pl. give points if this solution addresses your problem.

  • How to open a Filechooser on a button click from jsp page

    can anyone tell me how to open a Filechooser on a button click from a jsp page.
    Thanks

    <input type="file" name="myfile">

  • Invoke Event Recievers on button click

    Hi all,
    I Have an Event Reciever which updated a column of the list whose name is specified,
    I have an Webpart with ListName(Txt Box) and a Button Control,
    On click of which the Event Reciever that I have created should be invoked on the ListName Given in the Txt Box.
    How can I do this, plz help
    Thanks in advance

    Hi,
    Now If i am correct then you just want to activate an EventReciever on click of button on a Page using Object Model code and you have your Event Reciever already deployed and register in Global Assembly Cache.
    To do this just add this code on the button click event on page.
    using (SPSite site = new SPSite(SPContext.Current.Web.Url))
    using (web = site.OpenWeb())
    SPList list = web.Lists["ListName"];
    if (list != null)
    string className = "YourClassNameSpace.YourClass";
    string asmName = "NameOftheAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken={PublicKeyToken}";
    web.AllowUnsafeUpdates = true;
    //add the added/updated/deleted events to the list.
    list.EventReceivers.Add(SPEventReceiverType.ItemAdded, asmName, className);
    list.EventReceivers.Add(SPEventReceiverType.ItemUpdated, asmName, className);
    list.EventReceivers.Add(SPEventReceiverType.ItemDeleted, asmName, className);
    list.Update();
    Mark as Answer if helped!! To be or Not to Be..The question is this only......

  • Calling multiple url's base on button click in JSP

    I am trying to call a different jsp depending on which button is clicked on my jsp.
    The way I currently have it working is by posting and I set the url in the action attribute of the form.
    Anyone ever do this or have a solution?
    Thanks.

    I tried the following code but it did not seem to work.
    Do I have to change anything on my form line?
    <form name="form1" method="post" action="/TestJSPModule/DbMaint_Submit.jsp">
    Is the document.forms format exactly the way I have to type it?
    Or is it the actual form name.
    If form name is form1
    Example: document.form1
    <script language="javascript">
    function submitForm(){
    if (document.forms[0].Submit.value='Insert')
    document.forms[0].action="url1";
    if (document.forms[0].Submit2.value='View')
    document.forms[0].action="url2";
    if (document.forms[0].Submit3.value='Delete')
    document.forms[0].action="url3";
    document.forms[0].submit();

  • How to invoke more then one service from single button click

    Hi,
    I have created web service data control which contains more then one services.
    Now my problem is when I press button, it should take data from my input component and needs to set into multiple services and response of those services should be display to my binding component on the screen.
    Regards,
    DevangD

    See : 9.11 Overriding Built-in Framework Methods
    here: http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcservices.htm#sm0222
    You can have the code that was generated modified to invoke an additional action - you'll need to add the binding to that action to your page.

  • To open a window & html page at a time on a single button, in JSP.

    Hello!
    I want to open 1 window as well as i want to open 1 html page on a single button click at a same time, in JSP.
    on button's "action" event i am opening the html page and button's "onclick" event i am opening the window, but it is not showing these 2 actions at a time. only window gets open when i click the button.
    [Also on form's "action" event i am having validate() function.]
    how do i open a window & html page at a time on a single button, in JSP?
    I don't know how to do this. I have stuck over here, if anyone is having any solution, please let me know.
    I need your help.
    Thank You.

    write js as
    window.open(page, "Popup", windowprops);
    windowprops = "height="+hi+",width="+wd+",top="+ wint +",left="+ winl +",location=no,"
              + "scrollbars=yes,menubars=no,toolbars=no,resizable=no,status=yes";
              encapsulate this in one function and call that function on button click event !!

  • Report on button click

    Hi experts,
    i hope you all are doing fine.I need your help ....i generated a report in rtf format using iText and stored in a file name like 'xyz.rtf'.Now i want to open this file on button click in jsp.
    Pls. suggest me something....
    Thanks a lot...appreciate any kind of help.
    Sonika

    Thanks bsampieri,
    Thanks a lot for your reply......but it says that the requested resource is not available...
    here i am sending you the code:
    try{
    Document document = new Document();
    // step 2:
    // we create a writer that listens to the document
    // and directs a RTF-stream to a file
    RtfWriter rtf = RtfWriter.getInstance(document, new FileOutputStream("/try4.rtf"));
         rtf.setHasTitlePage(true);
         RtfHeaderFooters header = new RtfHeaderFooters();
         header.set(RtfHeaderFooters.FIRST_PAGE, new HeaderFooter(new Phrase("UNSODA DATABASE"), true));
    document.open();
    document.setHeader(header);
    document.add(new Paragraph(" UNSODA DATABASE", new Font(Font.HELVETICA, 20, Font.BOLD)));
    document.close();
    } catch(Exception e){
    out.print("erwerweror"+e.toString());}
    %>
    //and then in button or for calling report
    <tr><td bgcolor="#CCCCFF">
    <input type='button' name="Report" onClick= "<%= theFileURL%>" value="Add New Record"></td></tr>
    but it gave me this error:
    The requested resource (/try4.rtf) is not available.
    Thank you....so much
    sonika

  • Associating two events with submit button using  javascript in jsp

    Hi
    How can i Associate two events with submit button using javascript in jsp. Firstly it should insert the data to database and secondly it should close the same pop-up window

    Have something like :
    <input type="submit" name="submitbtn" value="Click me" onClick="function1(); function2(); " />
    You just call both functions sequentially, it's that simple. Although using javascript to work with a database, that seems a bit tricky.

  • How can we set two events in a single button ???

    HI
    I created a button named bold , when i click it first time the textarea texts will became as bold..
    I created another button bold cancel when i click at that button textarea texts will became plain...
    But how can i set that controls in a single button (in button bold) ???
    Would anybody please tell me ...

    I would have one event listener that is aware of a boolean variable that has scope outside of the event listener, isBold for instance?
    When you click on the button, have the event listener toggle the boolean variable and then if true, set the text to bold, if false set the text to plain.

  • Sharepoint 2010 Custom Visual Webpart button click event firing on page refresh

    I have developed a Visual Webpart to create a list in SP using vs2010 and  the button click event I have written the list create method. If I click the button list is created successfully.  And I refresh the page again list is creating(Again button
    click event is triggering).please help me to solve the issue.
     protected void Button1_Click(object sender,
    EventArgs e)
                SPWeb web
    = SPContext.Current.Web;
                //SPList list=web.Lists["Auto"];
                SPList list
    = web.Lists[DropDownList2.SelectedItem.Text];
                if
    (string.IsNullOrEmpty(TextBox1.Text)
    || string.IsNullOrEmpty(DropDownList1.Text))
    Label4.Text =
    "Fields Are Empty";
                else
    if (DropDownList1.SelectedItem.Text
    == "Single line of Text")
                    list.Fields.Add(TextBox1.Text,
    SPFieldType.Text,
    true);
    SPView viewname = list.Views["All Items"];
                    viewname.ViewFields.Add(TextBox1.Text);
    //viewname.Update();
                    list.Update();
    Label4.Text =
    "Field Created Successfully";
    TextBox1.Text =
    string.Empty;
    // Label4.Text = string.Empty;

    Hi,
    This is because the request is sent to the server when you refresh the page.
    A workaround for this is that we can “provide a refresh link that redirects to the same page (or if you have some action causing the refresh programmatically, you could just
    redirect to the page after that, with Response.Redirect)
    so that page is requested by the browser (with GET method, default with hyperlinks)”.
    More information:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/45648b39-1229-405c-ac9e-60eb82905982/click-event-getting-fired-on-page-refresh
    Or we can use the Session to save a value which used as a flag for us to check whether it is a page refresh and perform accordingly.
    http://www.codeproject.com/Articles/28099/Refresh-Page-Issue-in-ASP-Net
    http://www.codeproject.com/Articles/10240/Detecting-Page-Refresh
    Thanks
    Patrick Liang
    TechNet Community Support

  • Want value show on Eclipse console on click of jsp form button Hit

    Dear Friends,
    I have a Jsp file in which the client enter some value and when s/he click on submit button then that value which is in text box field is shown on console.
    According to my knowledge/Logic on the button click event the value get through getQueryString/ getParameter depends on the form methods and show that value in console through S.O.P .
    I am really appreciate for ur help.
    Thanx in Advance.

    I cannot understand ur question.
    U wanted to display the values at client side console (or) server side console?
    if ur wanted to display in server side console.
    Just use
    System.out.println(""+request.getPerameters('"<test box name what ur given in html form>"));
    If ur wanted to display in console. According to my knowledge it is not possible. Because we r using http protocol for sending request and receiving response..
    so only the response ur getting form server is display by the browser only.

  • Error with No Message on Button Click Event

    Hi,
    I am getting a framework error on button click event.
    I have a page in which shuttle component is there,on click of the commit button the page traversed to main jsp page there i am getting error like ERROR and only '-'.
    In application module java file i have written the code for the shuttle component which creates the new row and set the values.

    Hi Frank. Thanks for the answer. Kindly check the code for shuttle component below. This is written in the Application Module (..ServicesImpl.java)
    public void multipleShuttle(List productIds,String reqRefNumber,Date orderDate,String hoSectionCd)
    System.out.println("Its entering into the test method");
    System.out.println("Inside updateSkillsForCurrentStaff method");
    System.out.println("reqRefNumber:"+reqRefNumber);
    System.out.println("orderDate:"+orderDate);
    System.out.println("hoSectionCd:"+hoSectionCd);
    if (productIds != null && productIds.size() > 0)
    List<Number> copyOfProductIds = (List<Number>)Utils.cloneList(productIds);
    //List copyOfProductIdsNames=Utils.cloneList(productIds);
    System.out.println("list values "+copyOfProductIds);;
    //System.out.println("list values "+copyOfProductIdsNames);;
    ViewObject skills = getMsMsOrderHdrUO2();
    RowSetIterator rsi = skills.createRowSetIterator(null);
    // remove any rows for the current user that aren't in the list of product keys
    while (rsi.hasNext())
    Row r = rsi.next();
    Number productId = (Number)r.getAttribute("MsDepotCd");
    System.out.println("depot from row setter "+productId);
    // if the existing row is in the list, we're ok, so remove from list.
    if (copyOfProductIds.contains(productId))
    copyOfProductIds.remove(productId);
    // if the existing row is in not list, remove it.
    else {
    r.remove();
    rsi.closeRowSetIterator();
    // at this point, we need to add new rows for the keys that are left
    for (Number productIdToAdd: copyOfProductIds)
    Row newRow = skills.createRow();
    skills.insertRow(newRow);
    try
    System.out.println("productIdToAdd"+productIdToAdd);
    System.out.println("inside attributes setter try method");
    //AS PER THE NEW REQUIREMENT ORDER STAUTS WIL BE 'DRAFT' AND ON APPROVAL BY JGM THEN IT WILL BE 'APPROVED'
    newRow.setAttribute("OrderStatus","DRAFT");
    System.out.println("Depot Code set is"+newRow.getAttribute("DepotCd"));
    if(productIdToAdd.equals("0"))
    System.out.println("inside the HO method to set section");
    newRow.setAttribute("HoSections",hoSectionCd);
    System.out.println("After setting the values");
    catch(Exception e)
    System.out.println("Exception Caught"+e);
    getDBTransaction().commit();
    orderDetailInsertProcedure(reqRefNumber);
    }

  • Printing different pages by clicking single button

    Hi,
    I want to print different jsp pages by clicking single button.all process should be done in back ground.Is there any way to do this.
    please help me.
    thanks

    If you are using JavaScript you can do the following:
    In the HTML Header add :
    <link rel=alternate name="printlink" media=print href="{path to jsp}">
    This will cause the jsp/html page pointed at in {path to jsp} when you do a javascript:window.print().
    Such as :
    <input type="button" class="stdButton" value="Print" name="Print" onClick="javascript:window.print();">
    If you have different pages to print you can redirect the link like this:
    <input type="button" class="stdButton" value="Other Report" name="OtherReport" onClick="printOtherReport();">
      function printOtherReport() {
      window.document.getElementsByTagName("link").item(0).href   = "{path to other jsp}";
      window.print();
      window.document.getElementsByTagName("link").item(0).href = "{path to first jsp}";

  • How to call elem. Search help on Button click event in WD appilcation

    Hello All,
    i have requirement to call elem. search help on button click event in WD application. currently i am calling FM  F4IF_START_VALUE_REQUEST but getting the short dump as below,
    The following error text was processed in the system X31 : Screen output without connection to user.
    The error occurred on the application server saps_X31_31 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    SYSTEM-EXIT of program SAPLSDH4
    Function: F4_PRESEL_WITH_TABSTRIP of program SAPLSDH4
    Form: F4PROZ_STEP_PRESEL of program SAPLSDSD
    Function: DD_SHLP_SINGLE_STEP of program SAPLSDSD
    Form: F4PROZ_LOOP of program SAPLSDSD
    Form: F4PROZ of program SAPLSDSD
    Function: F4IF_START_VALUE_REQUEST of program SAPLSDHI
    Method: ONACTIONSEARCH_CUSTOMER of program /1BCWDY/50TU5ZEXF3K0IWCWE153==CP
    Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/50TU5ZEXF3K0IWCWE153==CP
    Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
    is there any way to achieve the required behaviour.
    please let me know.
    Regards,
    Chandra

    Hi Friends,
    I have the similar kind of requirement. Upon click on a Button on screen i need to call a search help, and collect one or more selected material numbers.
    The search help is working fine and i am getting the entries with the following code.
    The problem is i am finding extra popup on screen.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
    tabname         =  space
    fieldname       =  space
    SEARCHHELP      =  'MAT1'
    MULTIPLE_CHOICE =  'X'
    STEPL           =  0
    value           = 'MATNR'
    *dynpprog        =  progname
    *dynpnr          =  dynnum
    *dynprofield     = 'CARRIER'
    CALLBACK_PROGRAM          = 'ZTEST_1_PRA'
    CALLBACK_FORM             = 'F4CALLBACK'
    TABLES
    RETURN_TAB                = RETURN_TAB
    EXCEPTIONS
    FIELD_NOT_FOUND           = 1
    NO_HELP_FOR_FIELD         = 2
    INCONSISTENT_HELP         = 3
    NO_VALUES_FOUND           = 4
    OTHERS                    = 5.

Maybe you are looking for

  • Authorize use of music on new computer

    Hello, I'm new to this forum. I'm not sure if I'm using the correct verbiage of "Authorize" it to use it. I have been using iTunes 6 (I believe that was the version) on an old Compaq computer with Windows XP. The computer crashed and after changing h

  • Firefox.exe located in appdata\local\mozilla firefox - why?

    I do malware remediation for a company. In some recent investigations, I've found a few computers using firefox, and it is running from this location: c:\users\username\appdata\local\mozilla firefox\firefox.exe. (This location exists in versions 15.0

  • Error message on email on droid razr

    Keep getting connection error. Unable to connect to imap.vsw.net. (read error: ssl=0x9c2750:i/o error during system call.  Started on one of my accounts now its doing it on others.  Can anyone help?

  • False Duplicates when importing

    Maybe I'm being dense but I keep having hassles when importing photos in iPhoto. Sometimes when importing from my Konica Minolta Dynax 7D (an old but supported camera) iPhoto prompts me that a duplicate is being imported and asks if I'd like to repla

  • Regarding BADI error handling

    Hi, I have a requirement to generate a reference code for a publication and when the publication is saved with out reference code it should display message on the portal. So how can we handle error messages in the BADI or in the E-Recruiting portal.