This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Struts and the fly likes Issue in populating  field in parent window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Issue in populating  field in parent window" Watch "Issue in populating  field in parent window" New topic
Author

Issue in populating field in parent window

Suzi Cooper
Ranch Hand

Joined: Jul 23, 2005
Posts: 45
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???
 
 
subject: Issue in populating field in parent window
 
It's not a secret anymore!