View previous topic :: View next topic |
Author |
Message |
jmoran
Joined: 10 Apr 2006 Posts: 16
|
Posted: Tue Nov 14, 2006 2:59 pm Post subject: Passing value back to Parent |
|
|
Hi -
I have a license for FlatCalendar. I have my main window with an icon that when clicked will popup the calendar in a new window. When the date range is selected I need to populate the MAIN window with the selection. Right now I can only get the fields to populate to text fields on the popup window. How can I access the 'true' parent?? Right now gContainer is pointing to the new window. In order to open the new window, I am calling a backend servlet with a target of _new, I am NOT using window.open because I don't know how to call a backend servlet through this method.
Thank you for your help.....
Jennifer
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Tue Nov 14, 2006 3:23 pm Post subject: |
|
|
The main window should be the opener of the popup window. Therefore, supposing the field on your main window is form1.field1, all you need is to have the following code in your plugins.js, usually in fAfterSelected():
Code: | gContainer.opener.form1.field1.value = "...."; |
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Last edited by calendarxp on Tue Nov 14, 2006 9:58 pm; edited 1 time in total |
|
Back to top |
|
|
jmoran
Joined: 10 Apr 2006 Posts: 16
|
Posted: Tue Nov 14, 2006 4:28 pm Post subject: |
|
|
I am getting 'gContainer is undefined'
here is the link from the main page
<a href="/maherwebapp/billingAction.do?index=0&guaranteeContainer=CCLU331650&method=initialCalendar" target="_blank">
The billingAction servlet forwards to the calendar.html page
the calendar.html page is as follows
<script>
function fOnRange(rng) { // call back from within the calendar engine.
var sd=new Date(rng[0]);
var ed=new Date(rng[1]);
gContainer.opener.forms[0].pageTitle.value=sd.getUTCFullYear()+"-"+(sd.getUTCMonth()+1)+"-"+sd.getUTCDate();
// window.document.all['summaryArray.paymentFromDate'][0].value=sd.getUTCFullYear()+"-"+(sd.getUTCMonth()+1)+"-"+sd.getUTCDate();
// window.document.all['summaryArray.paymentToDate'][0].value=ed.getUTCFullYear()+"-"+(ed.getUTCMonth()+1)+"-"+ed.getUTCDate();
}
</script>
<form name="fm">
<table>
<tr>
<td>Selected range start</td>
<td><input name="startDate" size=14></td>
</tr>
<tr>
<td>Selected range end</td>
<td><input name="endDate" size=14></td>
</tr>
</table>
</form>
<iframe width=174 height=189 name="gToday:normal::gfCalendar" id="gToday:normal::gfCalendar" src="./calendar/iflateng.htm" scrolling="no" frameborder="0">
</iframe>
|
|
Back to top |
|
|
jmoran
Joined: 10 Apr 2006 Posts: 16
|
Posted: Tue Nov 14, 2006 5:32 pm Post subject: |
|
|
Hi -
Please disregard my previous post, I was able to use window.opener and open the calendar.html directly....
BUT
when the popup window comes up I am getting this IE Error message
Line: 6
Char: 1
Error: syntax error
Code: 0
URL: http://localhost:8080/maherwebapp/calendar/iflateng.htm
Thanks again for your time,
Jennifer
|
|
Back to top |
|
|
jmoran
Joined: 10 Apr 2006 Posts: 16
|
Posted: Tue Nov 14, 2006 9:14 pm Post subject: |
|
|
Please disregard, it is working fine now.
Thanks for the help,
Jennifer
|
|
Back to top |
|
|
|