aspose file tools*
The moose likes Struts and the fly likes Submitting the parent jsp from a chile jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Submitting the parent jsp from a chile jsp" Watch "Submitting the parent jsp from a chile jsp" New topic
Author

Submitting the parent jsp from a chile jsp

vijay ks
Greenhorn

Joined: Oct 27, 2005
Posts: 9
Below is the code for my application, i am entering value in the parent and click the delete button it pops up the child , when i cliking the Yes button , the parent page is submitting , but the text i enter is not populate in the form . Help needed


The following parent jsp

parent.jsp
<script type="text/javascript">
function confirmDelete(){ window.open('./jsp/child.jsp','popupwindow','location=1,status=1,scrollbars=1,width=300,height=300');
}

</script>
<nested:form action="/displayqueries">
<nested:text property="name"/>
<input type="button" name="delete" value="Delete" onclck="confirmDelete()"/>
</nested:form>

Child.jsp

<html>
<head>
<script type="text/javascript" language="Javascript1.2">
function confirmSelection(val){
if(val=="Yes"){
var openerForm = window.opener.document.forms[0];
openerForm.action="autotcdisplayprocess.wss?delete=yes";
openerForm.method = "post";
openerForm.submit();
}
self.close();

}
</script>
</head>

<table border="0" width="100" height="100">
<tr>
<td align="right">
<img src="//w3.ibm.com/ui/v8/images/icon-link-action.gif" alt="action link icon" width="17" height="15" onclck='javascript:confirmSelection("Yes")'>Yes</td>
<td width="50%" align="left">
<img src="//w3.ibm.com/ui/v8/images/icon-link-action.gif" alt="action link icon" width="17" height="15" onclck='confirmSelection("No")'> No</td></tr>
</table>

</html>
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
hmmmm...I see that in your child script you are dynamically setting the parent action and method. Has this approach worked for you in the past or have you seen examples of this? What I do in this case is to set the value of a hidden form field. Then when the page is submitted I detect that the value is set and forward back to an action that refreshes the page with the updated values.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Submitting the parent jsp from a chile jsp