• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

Issue in populating field in parent window

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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???
 
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic