CalendarXP.net Support Forum Index CalendarXP.net Support
Most forums here are private and invisible to public.
 
 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing value back to Parent

 
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> FlatCalendarXP Related
View previous topic :: View next topic  
Author Message
jmoran



Joined: 10 Apr 2006
Posts: 16

PostPosted: Tue Nov 14, 2006 2:59 pm    Post subject: Passing value back to Parent Reply with quote

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
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Tue Nov 14, 2006 3:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
jmoran



Joined: 10 Apr 2006
Posts: 16

PostPosted: Tue Nov 14, 2006 4:28 pm    Post subject: Reply with quote

I am getting 'gContainer is undefined'

here is the link from the main page

<a href="/maherwebapp/billingAction.do?index=0&amp;guaranteeContainer=CCLU331650&amp;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
View user's profile Send private message
jmoran



Joined: 10 Apr 2006
Posts: 16

PostPosted: Tue Nov 14, 2006 5:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
jmoran



Joined: 10 Apr 2006
Posts: 16

PostPosted: Tue Nov 14, 2006 9:14 pm    Post subject: Reply with quote

Please disregard, it is working fine now.

Thanks for the help,

Jennifer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> FlatCalendarXP Related All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Copyright 2003- Idemfactor Solutions, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group