How to parse parameter from child window to parent window in JSP

I have two JSP i.e. course1.jsp and course2.jsp. I would want to find out how I could parse the parameter/value from child window to the parent window when the child window get closed.
What I am trying to do is actually a file upload process. The child windows will open for user to upload the file, and when close, the file name will be parse into the parent form for database update. Is this something possible at all? or is there any other better approaches.
Thank you.
These are the two files:
--------course1.jsp ------------
Attach File <p>
<FORM name="courseForm" action="course2.jsp" method="post" enctype="multipart/form-data">
<TABLE cellSpacing=1 cellPadding=3 border=0 WIDTH=500>
<TR >
<TD>
<input type="text" NAME="f_file_name" size="30" VALUE="this value should be taken from child windows">
get file name
<p>
     <INPUT class="buttons" TYPE="submit" NAME="submit" VALUE="Submit">
</TD>
</TR>
</TABLE>
</FORM>
---- course2.jsp -------
<%
String filename = "this is the string needs to go back to parent windows when I click on close";
%>
<p>
close

In course2.jsp, you have to write some javascript code to reload the parent window document to reload the document with an added parameter. But, instead of doing this, you can also do simple thing; in course2.jsp, you can reference course1.jsp controls via javascript object, "parent". On closing event of course2, you can write:
parent.courseForm.f_file_name.text = '<%=filename%>' ;
window.close() ;
But for this to work, you must open your course2.jsp document thru window.open() function instead of simple hyper link (as you did thru ).
So, modify the hyperlink line like below:
get file name
Hope it helps.

Similar Messages

  • How to pass a data from child window to parent window

    Hi,
    I have a jsp page with two hidden fields and a button, On clicking the button a popup will come out. There are two combobox in the popup and a search button. After putting a value in the comboboxes,if I click the search button, I need the datas of the combobox to pass to the parent's hidden fields then I need to do a data base search with that values of hidden fields and display the result in the parent page.
    I could I solve this problem, Please help, Its urgent.
    Thanks and Regards
    Rajib Sharma

    I think that you can use the JavaScipt as follow to pass a data from child window to parent window
    <HEAD>
    <script>
    function passData(){
    opener.form1.test1.value=form2.test2.value; //pass the value of test2 to the parent's test1
    window.close();
    </script>
    </HEAD>
    <BODY>
    <form name=form2>
    <input name=test2 type=text>
    <input type=button onclick="passData()" value=CLOSE>
    </form>
    </BODY>

  • Problem in Passing the value from child window to Parent window.

    Hi Frenz,
    I have a requirement like this. i have to pass a value from child window to parent window to one test field. That text field is not a normal text field.
    It was created like the following as SQL query.
    select
    ''LNo,
    apex_item.text(25,'',0,15,
    'style="width:100px;" onblur="javascript:showUpsell(this.value);" onkeypress="javascript:validateKeyPress(event,this.value,this.id);" onkeyup="javascript:this.value=this.value.toUpperCase();" id="P37_ITEMNO"') ItemNo
    Now i want to pass a value to the Item no from child window.
    i wrote the java script like this,
    opener.document.forms[0].f25.value="100";
    It was not working..Any suggestions for that..
    Thanks in advance

    Dear Baaju,
    How do you redirect your control from Child to Parent window.
    If you use a button to do this, then you can set this value in the branching of page.
    Rana

  • How to close child windows when parent window closed in jsp

    how to close child windows when parent window closed in jsp
    becoz it can't be able to recognise it's parent
    with the whole application
    plz send me some sample code of it

    Hi, I have no idea how to do this is JSP.
    However createing a modal window (with javascript) would mean that the user can not use the parent window untill he closes the child window. However not sure if this is what you are searching.
    Otherwise you can detect the onClose (I think) and close the window from there.
    However both the above are JavaScript and not JSP.
    rwgards,
    sim085

  • How Can I Print from my Microsoft Surface Running Windows 8 RT?

    How Can I Print from my Microsoft Surface Running Windows 8 RT?
    Most new wireless printers won’t have a problem printing from the Microsoft Surface with Windows 8 RT.  All you should have to do for these printers is tell them to print and they will.  Older wireless, Ethernet, and USB printers might not have an officially supported driver in Windows 8 RT, but there is a way to get the printers working.  There are different requirements depending on how the printer is being connected to the Surface. 
    Note:  All steps below are only for PhotoSmart, OfficeJet, DeskJet, and other HP Inkjet printers.  These steps are not for Laserjet printers or printers from other manufacturers.  These steps may not work for all Inkjet printers.  If these steps don’t work, try different drivers from the list until you find one that will work (you’ll understand what I mean once you follow the steps below).  If none of the drivers work, your printer will not work with the Surface.
    For networked printers (wireless or Ethernet), all you need is either the Surface keyboard, or an external USB keyboard to connect to the Surface.  This just makes anything you have to type easier to type.  You will also need to have the Surface and the printer connected to the same network. 
    Starting from the right edge, swipe your finger left on the Surface screen to bring up the Charms bar.
    Touch Search.
    Below the Search Box, touch Settings.
    In the search Box, type Devices and Printers.
    Touch Devices and Printers.
    Touch Add a Printer.
    Touch “My printer is not listed”.
    Select the TCP/IP option and touch Next.
    Enter the printer’s IP address and touch Next.  Note:  You can get this from the printer’s Network Configuration Page, or from your router’s DHCP list.
    The Surface will locate the printer and try to install it.  The install will fail and the Surface will ask you what you want to do, search the internet for the driver, or manually install the driver.  Choose to install the driver yourself.
    Touch “I want to choose from a list of drivers”.
    If no drivers appear in the list, make sure the box next to “Show compatible drivers” is not checked.
    Choose HP from the Manufacture list.
    Choose DeskJet PCL 3 Class Driver from the Drivers list.  If that driver doesn't work, try using the Photosmart PCL3 driver, or the Officejet PCL 3 driver.  (Thank you JonW for letting me know about these other alternates. )
    Touch Next.
    Touch Finish.
    Test printing.
    For USB connected printers, you will need a USB cord to attach the printer to the computer.
    Connect the printer to the computer via USB.
    Windows will try to find the drivers but will not be able to.
    Here Windows may ask you if you want to choose the driver to install.  If it does skip to step 14 below.
    Starting from the right edge, swipe your finger left on the Surface screen to bring up the Charms bar.
    Touch Search.
    Under the Search box, touch Settings.
    In the Search box, type Device Manager.
    Touch Device Manager.
    Touch View and select Show Hidden.
    Search for the printer in the Device Manager.  It should be under Other Devices with a yellow caution sign beside it.
    Select the printer from the list.
    Touch Action.
    Touch Update Driver, or Install whichever one it displays.
    The Surface will ask you what you want to do, search the internet for the driver, or manually install the driver.  Choose to install the driver yourself.
    Touch “I want to choose from a list of drivers”.
    If no drivers appear in the list, make sure the box next to “Show compatible drivers” is not checked.
    Choose HP from the Manufacture list.
    Choose DeskJet PCL 3 Class Driver from the Drivers list.  If that driver doesn't work, try using the Photosmart PCL3 driver, or the Officejet PCL 3 driver.  (Thank you JonW for letting me know about these other alternates. )
    Touch Next.
    Touch Finish.
    Test printing.
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------
    This question was solved.
    View Solution.

    Hope this helps.  
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • How to   Pass Parameter from BIP  to Dashboard  Report

    Hi,
    Parameter from BIP to Dashboard Report
    If I select BIP report paremeter should pass value to dashboard report
    thanks in advance.
    CHEERS ,
    Jel

    Hi Saichand,
    I hav gone through above link its passing values from Dashboard prompt to BIP report only..
    just i need like reverse (if i click on BIP report value then it should pass that value to Dashboard reports) in this this case how to pass parameter from BIP to dashboard report
    Thanks in advance
    Cheers,
    Jel

  • How do I print from Adobe Reader in MS Windows 8?

    How do I print from Adobe Reader in MS Windows 8?

    See FAQ: Printing from Adobe Reader for Windows 8 Tablets.

  • Hi I'm new to Mac & I have bootcamp on it but am stuck, how do I get from Mac side to the Window side?

    Hi I'm new to Mac & I have bootcamp on it but am stuck, how do I get from Mac side to the Window side?

    Hold the "option" key on boot.  Choose the system to boot.
    Then "System Preferences > Startup Disk" to select Max OSX as your default system.
    There is another "system preferences" in the Windows menu that is added by bootcamp to make it the default, but I do not know the details of that.

  • Processing Child form on parent window..

    Hi.. anyone here has any idea how to process a child form on a parent window.. like for example, i click on submit button on the child window, and the form directs to another JSP file which its results should be display on the parent window.. anyone has any idea?

    Hi!
    I had similar problem, I used frames and needed to submit a form from a frame to parent window. I used property "target" of form to specify where I want this form to be submitted, like this:
    function submit() {
         form.target = "name of the target where to submit";
         form.submit();
    or something like this:
    <html:form action="/blahblah" target="name of the target where to submit" method="post">
    hope it helps
    Vassili Skarine

  • Problem: Passing the business data from Child DC to Parent DC

    HI Dear All,
    I    developed two DC,s Parent and Child DC,i am able to pass the data from Parent DC to CHild DC,when i am trying to pass the data from Child DC to Parent DC i am unable to map the context attributes. Is it possible to pass the data from Child DC to Parent DC.
    Thanks in advance,

    What I wrote earlier:
    Yes you can acheive it by doing a flip. ie, in this case the present Parent DC will become Child DC and present Child DC will become Parent DC. Now you can share the context atrributes in reverse way (ie, you can access the context attributes of current Parent DC in current Child DC).
    Sorry Parameshwari. As Anand suggested, It will give an error called Cycle in component usage definitions, if you are doing the procedure what I suggested.
    In that case only you can do only one thing , you should maintain the requried context attribute in child DC and you can use it in parent DC.
    Child DC using Parent DC's context attribute is not possible.
    Regards,
    Jithin

  • How to  pass data between JDialog and its parent window ?

    Hi,
    I am new to swing. I want to know how pass data between a JDialog and its parent window.
    If you have any information please reply with example code.
    Thank You

    hi Encephalopathic ,
    I was looking for something like as it was given in the link provided by you.
    Thank you for reply It really helped me.

  • How to use Parameter from file in window env

    hi All,
    Please tell me the how I can get Parameter from Saved file and can use in other file.
    EX:
    I want to use Password file for each instance like
    ORCL-manager
    ORCL_1-tiger
    ORCL_2-*****
    how to call this file in other file. using pasword for instance
    any help would be appereciated.
    Regards,

    You can use SFTP for this.
    This is a way of implementing SFTP in SSIS using standard tasks 
    http://visakhm.blogspot.in/2012/12/implementing-dynamic-secure-ftp-process.html
    also see
    http://blog.goanywheremft.com/2011/10/20/sftp-ftps-secure-ftp-transfers/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to use DOMParser from an Applet / Or, how to parse XML from an Applet?

    Hey,
    As stating in the subject line, I wonder how to do it without getting an �Access Denied� error.
    I would like to parse a XML file that has external DTD pointing to a SYSTEM location. Yes, I can change it to a public location. However, in either way, I have problems to use DOMBuilder to parse the xml file. The application always throws the security exception.
    I tried to use the DOMParser from org.apache.xerces.parsers to parse the xml file. I set the DOMParser to ignore parsing the external DTD, and use the DOMParser.parse(InputSource) to parse the xml file from a giving URL. However, I get null of the result document.
    Does anyone know how to parse the XML from an Applet? Or, does anyone know how to use the DOMParser from an Applet?
    Thank you very much,

    If the document resides on the local filesystem, you will need to sign a CAB or JAR for the applet to circumvent the sandbox's security restrictions. There are dozens of posts on how to do this. Basically, that will turn the applet into an application, from a Java security perspective.
    - Saish
    "My karma ran over your dogma." - Anon

  • How to parse contents from XML file in Java

    Hi All,
    I have a scenario like this . I have one xml file with key value pairs of ( name , URL ) . I have retrieved contents from XML file , now I want to parse these contents and store in a bean object.
    How to parse Contents of XML file??
    Thanks in advance,
    Rajendra.

    Hi All,
    I have a scenario like this . I have one xml file with key value pairs of ( name , URL ) . I have retrieved contents from XML file , now I want to parse these contents and store in a bean object.
    How to parse Contents of XML file??
    Thanks in advance,
    Rajendra.

  • How to pass parameter from FM to report without changing interface of FM

    Hello experts,
    How can I pass a table name from a FM to the report calling the FM, without changing the existing interface of the FM.
    Thanks,
    Ajay.

    Hi,
    I f you want to pass any parameter from FM to Report or Vice-versa, parameter should me maintained in the FM otherwoise you can't pass any other than existing parameters.
    Otherwise create a custom FM.
    Regards,
    Sunil

Maybe you are looking for

  • Service Desk: Basis Message has not been created

    Hi Experts After applying the laster patches on our SolMan (CRM Component) the Service Desk is not working properly. When creating a ticket with TA NOTIF_CREATE the error message pops up: Message 000000XXXX created in <SID> with the following error:

  • How do i use iTUNES vouchers?

    Hey all thanks fro your time, i am soom going to purchase some itunes vouchers because we have to start paying for the fab Ricky Gervais Podcast which i dont mind paying for. but because i am only 15 i can not yet access internet shopping through pla

  • IChat won't connet with AIM

    When i open ichat, it kind of goes crazy between connecting and loosing connection and then it says it could not connect with my AIM account. Does anyone know how to solve this? You can e-mail me at [email protected] cause I will prolly forget to che

  • Start JavaFx project using a Java class

    After hours of searching, I still can't solve this problem: I have a pure JavaFx project but need to start it with a Java class. It used to work with the Interface method, but (I guess) since the javafx update to 1.3, the JavaFx code starts executing

  • Make iframe automatically adjust height according to the contents without using scrollbar?

    Hello,  I am developing the site (www.meninasreais.com.br) and have a doubt. I created the base html - menu, header - in Adobe Muse. I'm trying to insert an iframe that automatically adjust the height according to the content of the blog. I tried wit