File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue in populating field in parent window

 
Suzi Cooper
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,
I am trying to display a resultset in a new window and based on the selection populate the parent window.Here is the problem : The code works fine if i use a plain old html form but in case of struts, the popup window is displayed but on submitting the value in the child window,it refreshes the resultset and does not populate the field in the parent window.
Here is the code snippet:
######### parent JSP page ########
<script type="text/javascript">
function OpenWindow(){
var winPop = window.open("http://localhost:8080/mweb/deviceIdList.do","winPop");
}
</script>
.............
<html:form action="/DeviceDetailEdit">
.........
<td width="200" class="body" height="30"><bean:message key="mweb.cm.device.device_id"/></td>
<td width="400">

<logic:equal name="deviceDetailEditForm" property="action_mode" value="blankf"><input type="text" name="device_id"/> "& lt <input type="button" name="button" value="Grab Info" onKlick= "OpenWindow()" > "& lt /logic:equal>
</td>.......
####child jsp page###########
<script type="text/javascript">
function SendInfo(){
for (counter = 0; counter < formPop.textPop1.length; counter++)
{
if (formPop.textPop1[counter].checked)

var txtVal = document.formPop.textPop1[counter].value;
}

window.opener.document.deviceDetailEditForm.device_id.value = txtVal;

window.close();
}
</script>
.............

<form name="formPop">

<logic:iterate name="deviceIdListForm" property="deviceDetails" id="deviceDetail">
<tr class="formbody">
<td class="body" height="30"><input type="radio" name="textPop1" value ="<bean:write name="deviceDetail" property="device_id"/>"> <bean:write name="deviceDetail" property="device_id"/></td>

<td><html:image page="/images/cm/ok.jpg" onKlick="SendInfo()"> "& lt /html:image></td>
</tr>
</logic:iterate>
.........
Any ideas where i am going wrong???
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic