This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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???
reply
    Bookmark Topic Watch Topic
  • New Topic