Sending TABLE data in child window to parent window

My question is as follows:
I have a JSP with a parent window, which opens a pop-up window.
In the pop-window there is a <TABLE> tag defined with a number
of <TD> definitions referencing columns of data from a database table.
There is also a 'select' button next to each row displayed.
On pressing the 'select' button I want the data to go back to the fields
in the parent window.
I am successfully displaying the data in the pop-up window
I have used the DOM model in the past and for other elements within this JSP - i.e. drop down lists, sending data back to the parent window works fine, but I'm not sure of the syntax for referencing the TABLE items within the DOM model to send back to the parent window.
Any help on this would be very much appreciated.
Many Thanks
Chris

Well I've looked and I can't find anything wrong with it, but then I wrote it. I've included it as follows:
<%@page contentType="text/html"%>
<html>
<head>
<SCRIPT language=JavaScript>
function send_back(eventHandle)
if (opener == null) {
alert("\n Calling Window is no longer present. Will now close this window\n");
window.close();
else
if (eventHandle == "returnRow") {
<%-- Significant code below with the first statement referencing--%>
form name and item name and its value --%>
opener.document.produceTrans.studentID.value =
document.personLOV.personID.value;
<%-- statement below works so no that variable is correct-value --%>
<%-- part is wrong --%>
<%-- opener.document.produceTrans.studentID.value = "290000"; --%>
</SCRIPT>
<title>Person List
</title>
</head>
<%-- If the focus switches to the calling window this called window is closed
<BODY onBlur="window.close()"> --%>
<BODY>
<jsp:useBean id="personV" scope= "request" class="mypackage.PersonBean"/>
<jsp:setProperty name="personV" property="personName" />
<%-- Significant code below 1 with form name = personLOV --%>
<form name=personLOV METHOD="POST" action="transcript-control-servlet?Action=personList">
<TABLE >
<tr>
<td><input type='text' size=32 name="personName"> </td>
<td>
<input type="submit" name=personSearch value="Find Person">
</td>
</tr>
</TABLE>
<br>
<div style="width:480px; height:170px; overflow: auto;">
<TABLE border="1" cellspacing="1">
<tr>
<%
Vector personVector = new Vector();
try {
personVector = (Vector)request.getAttribute("listPerson");
for (Enumeration e = personVector.elements();
e.hasMoreElements();) {
personV = (mypackage.PersonBean)e.nextElement();
//Significant code below 2 with persID setup
String persID = personV.getPersonID();
%>
<tr>
<%-- Significant code below 3 with hidden field set to persID --%>
<%-- and name=personID --%>
<td><input type="hidden" name=personID value='<%=persID%>'></td>
</tr>
<tr>
<td><input type="button" name=SelectPerson value="Select"
onClick=send_back("returnRow")> </td>
<td><%= personV.getPersonID() %></td>
<td><%= personV.getPersonLastName() %></td>
<td><%= personV.getPersonFirstName() %></td>
<td><%= personV.getPersonBirthDate() %></td>
</tr>
<% } }
catch (NullPointerException ce) {
System.out.println("No records in list ");
%>
It is very straightforward and I believe I am referencing the correct form name/item name in the correct manner.
If I'm not then please tell me why not and how to fix it.
Thanks
Chris

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>

  • 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

  • Calling a function in child window from parent window

    Hi,
    How can I call a method in child window from parent window in adobe air using javascript. In the following example I need to call mytest() function in
    child.html from parent.html file.
    Thanks,
    ASM
    //parent.html
    <HTML><HEAD>
    <script>
    var initOptions = new air.NativeWindowInitOptions();
    initOptions.type = air.NativeWindowType.NORMAL;
    initOptions.systemChrome = air.NativeWindowSystemChrome.STANDARD;
    var bounds = new air.Rectangle(300, 300, 600, 500);
    var html2 = air.HTMLLoader.createRootWindow(false, initOptions, false, bounds);
    var urlReq2 = new air.URLRequest("child.html");
    html2.load(urlReq2);
    html2.stage.nativeWindow.activate();
    html2.window.mytest();       //NOT WORKING
    </script>
    </HEAD><body></body></HTML> 
    // child.html
    <HTML><HEAD>
    <script>
    function mytest()
      air.trace("in child window");
    </script>
    </HEAD> <body></body></HTML>

    I suspect your problem is that the child window hasn't been created by the time you call the function in the parent.Loading the content is an asynchronous processes -- AIR doesn't stop executing your code until the window has finished loading child.html. So, you will need to add an eventlistener to html2 and call the function from there:
    html2.addEventListener( "complete", onChildLoaded );
    function onChildLoaded( event )
         html2.window.mytest();

  • 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

  • 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 send data from popup window to parent window

    Hi,
    I need help some like this
    I have parent window ,in that i am clicking + button one dynamic row should add and one popup window has to diplay .Popup window contain 3 comboboxes and 5 text boxes. Once i am clicking OK button in popup window those values has to display at specified row in parent window
    Kindly help me ,
    Thanks
    jyothi

    See this
    http://www.oracle.com/technology/products/jdev/101/howtos/jsfdrilldown/index.html

  • 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.

  • Send table data through mail in oracle 10g

    Hi ,
    I am trying to send a mail through oracle 10g .
    I can send mail through utl_mail .
    The text that I need to send is data from a table .
    The table contains information about all the employees .
    Table name is person . If the employee is absent on any day without any reason there would be a row of this employee in the table person.
    There is also a column named email in this table .
    I need to write a stored procedure which will send the data about each particular employee to their respective email for all the employees in the person table .
    Can anyone please help me on this .
    Thank you.

    Try this forum thread first:
    Re: send email by procedure
    There are lots of articles on how to accomplish this taks on the web:
    -- utl_smtp example
    http://it.toolbox.com/wiki/index.php/Send_email_from_Oracle_Database
    http://www.databasejournal.com/features/oracle/article.php/3423431/Sending-e-mail-from-within-Oracle.htm
    -- From Application Express product
    http://www.oracle.com/technology/products/database/application_express/howtos/howto_workflow.html
    HTH -- Mark D Powell --

  • Window.opener  property from child window to parent window

    Hi
    When communicating between the child (popup) window to the parent window works fine as long as we pass the static reference to the window.opener
    Example :
    Main Page
    form name = staticform
    input name = col1
    Popup Page
    javascript :
    window.opener.staticform.col1.value = some value
    How can I use a dynamic reference for the staticform.col1 in the window.opener property to post the value back to the parent window ?
    thanks for the help
    sarma

    Actually, I think tolmank's would work... I've done basically the same thing before, but more like this (if it's generic, it's a good idea to have checks for the things being in existance). This is something I used in a generic color chooser I wrote in Javascript. Had multiple fields in one form using it for selecting different foreground/background colors.
    <%
    String form = request.getParameter("form");
    String fgfield = request.getParameter("fgfield");
    String bgfield = request.getParameter("bgfield");
    %>
    vfnSet = function() {
       if(typeof(window.opener) == 'undefined' || window.opener == null) {
          return;
       if(typeof(window.opener.document.forms['<%= form %>']) == 'undefined') {
          return;
       var oForm = window.opener.document.forms['<%= form %>'];
       if(typeof(oForm.<%= fgfield %>) == 'undefined') {
          return;
       if(typeof(oForm.<%= bgfield %>) == 'undefined') {
          return;
       oForm.<%= fgfield %>.value = document.forms['colorform'].foreground.value;
       oForm.<%= bgfield %>.value = document.forms['colorform'].background.value;
    }

  • Communicating from child window to parent window

    I'm been trying to communicate a child page with a parent page using window.opener, but I can't make it work. This is an example of what I've been working on (from child to parent). Any idea?
    <$-HTML>
    <$-HEAD>
    <$-TITLE>
    Ventana hija
    <$-/TITLE>
    <$-SCRIPT Language="javascript">
    function cerrar() {
         alert(window.opener.document.url())
         window.opener.frmPadre.field1.Value = document.frmHijo.field1.value;
         window.opener.frmPadre.field2.Value = document.frmHijo.field2.value;
         window.opener.frmPadre.field3.Value = document.frmHijo.field3.value;
         document.frmHijo.valor.value = document.frmHijo.field1.value;
         window.opener.frmPadre.btnSubmit.focus();
    <$-/script>
    <$-/HEAD>
    <$-BODY>
    <$-form name = frmHijo>
    <$-input type = text name = field1><$-br>
    <$-input type = text name = field2><$-br>
    <$-input type = text name = field3>
    <$-input type = button name = btnSubmit Value = "DEVOLVER" onClick = cerrar()>
    <$-/form>
    <$-/BODY><$-/HTML>
    The parent window hast a form name frmPadre with those 3 fields.

    Javascript is not java, but here are a couple of tips for debugging:
    You can use the browser address bar to alert stuff
    ie : put this into the address bar of your browser and see what happens: javascript:alert("Hello world")
    I would recommend you progress like this - slowly building up the link until you find where you go wrong.
    In this case, I think you missed out a "document"
    javascript:alert(window.opener)
    javascript:alert(window.opener.frmPadre)
    javascript:alert(window.opener.document.frmPadre)
    javascript:alert(window.opener.frmPadre.field1)
    Also just as a tip, cross browser scripting is a lot easier to maintain if you limit your self to calling FUNCTIONS in other windows.
    ie rather than setting the values in the other windows textfields, call a function (with parameters) which does it.
    eg in this case it might be:
    window.opener.setPadreFields(document.frmHijo.field1.value, document.frmHijo.field2.value, document.frmHijo.field3.value)
    The function would take the parameters and put them in the appropriate place on the form.
    Doing it this way decouples the pages a little - you only interact with the other page via the function (single point of entry) and if you modify the page in the future (eg change the name of a field) it is much easier to find everywhere you need to do this.
    Hope this helps,
    evnafets

  • Window.open always opens a child window with parent window propertiesin firefox 30

    By clicking on a link my code uses window.open which should open the response in child window. I am not specifying any height and width(as per requirement). In firefox alone, the window takes up the properties of child window and opens with same size as of parent window. Is there a way to restrict Firefox from inheriting the properties of parent window?

    Hi prajulakc,
    Thank you for your question. Currently the active window selected when you create a new window that new window will take the active window's screensize.
    You can add a preference: see also [https://support.mozilla.org/en-US/questions/754273 question/754273]

  • 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

  • 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.

  • Sending Table data using  RFC as a Web services

    Hi guys,
      I want to send ztable data from CRM system using RFC as a web service , but i want to read records only for a particular date and time , so how can i go about this scenario.
    regards;Keith.

    Hi Keith,
    for that scenario you need two RFC adapter. Of course you can use as well proxies as dicussed before. Forget about webservices.
    You told me above that you have z-table? add a date/time field and if a set will be inserted fill those fields with sy-datum / sy-uzeit.
    Your CRM select can now easy select only the actual data.
    Because of performance i would recommed a asynchron scenario, for example:
    A ABAP programm is selecting the data and is calling a module like
    CALL function 'myFunction'
    DESTINATION 'mySM59'
    IN BACKGROUND TASK
    This function module is build anywhere and imported into Repository and is working a outbound interface. Inbound interface is a second function module, which is imported from R/3. The ABAP source code of that module put the data to SAP system.
    The CRM ABAP programm will be called periodicly by a job.
    But!! I dont know ur requirements. Unfortunately you are one of thesse persons, who are asking without giving details. I'm not the prophet...
    Regards,
    Udo

Maybe you are looking for

  • Material cost updating in COPA at the time of Billing and Delivery 2 Time.

    Hi All I had created sales order( MTO). Sales Order No 61224069 u2013 50 Sales Order line item 40 created > PR & PO created (MD02) > MIGO > Delivery of Order (VL01N) > Settlement (VA88) >Billing( VF01) > Settlement (VA88). I have two COPA Document an

  • Warning: [deprecation] getRealPath in ServletRequest has been deprecated

    I have extended class HttpServletRequestWrapper for custom implementation I have neither overriden the method getRealPath(java.lang.String) nor has this method been used/accessed anywhere. I still get following warning [javac] /home/pangav1/dev/upgra

  • ICal opens by itself

    I've noticed that iCal will be open when I know I didn't launch the app. Any ideas what could be launching the app? I'm on iCloud running 10.7.2 Lion. I was going to assume the event reminders would launch it maybe? But if I recall correctly, it's be

  • Stop Plugin VI execution

    Hi Experts! I'm wondering about an elegant solution for my problem. I have a top level VI that contains subpanel, in order to call plugin VI interfaces into. The plugin vi itself has own state machine (JKI Queued State Machine) and called by VI Serve

  • Modify datasource on reports

    I am pretty new to crystal reports. I have inherited around 500 crystal reports where the datasource location is a ODBC(RDO) but pointing to actual databaseserver and databasename. Properties on the datasource look as follows: Database Tyoe: ODBC(RDO