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 

Trouble with many calendars on one page each using their own agenda

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



Joined: 03 Sep 2007
Posts: 3
Location: Maryland

PostPosted: Mon Sep 17, 2007 4:59 am    Post subject: Trouble with many calendars on one page each using their own agenda Reply with quote

I am having trouble placing many pop-up calendars on one web page each with its own agenda. The first calendar works fine, but the others seem to hiccup (e.g. not popup properly, fail to populate date field, fail to select default month/date, etc.) Enclosed are pictures and my code is below. I've tried making the NAME and ID attributes the same and different but nothing helps.

Any help would be much appreciated!
(I'm new to programming)
Thanks, paul

------BODY CODE----
<input name="my_date1" size="12" readonly="true" onFocus="this.blur()" value="click --&gt;" maxlength="12">
<a href="javascript:void(0)"
onClick="if(self.gfPop)gfPop.fPopCalendar(my_date1);return false;" ><img name="popcal" align="absmiddle" src="images/calbtn.gif" width="34" height="22" border="0" alt="select single day or week # (preferred)" onMouseOver = "SetAgendaName('my_task1')"/>

(the above code is repeated for each task. each has its own unique date input field and SetAgendaName() parameter)

------HEAD FUNCTION CODE-------- selects a unique agenda based on the task
<script language="Javascript" type="text/javascript">
function SetAgendaName(task)
{
// id="gToday:normal:agenda.js:gfPop"
var agenda_name = 'gToday:normal:' + 'agenda_'+ task +'.js:gfPop';
var html = '<ifr'+'ame name='+'"'+agenda_name+'"' +' name="'+agenda_name+'"' +' src="ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;"></ifr'+'ame>';
if (document.all)
document.body.insertAdjacentHTML('beforeEnd', html);
else {
var range = document.createRange();
range.setStartAfter(document.body.lastChild);
var docFrag = range.createContextualFragment(html);
document.body.appendChild(docFrag);
}
// alert(html);
}
</script>

(the first calendar uses the agenda_my_task1.js, the second calendar uses bob_task1.js, the third one uses john_task1.js, etc.)
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Mon Sep 17, 2007 12:37 pm    Post subject: Reply with quote

Since you are using different agenda per calendar, you need to give them different context names, eg. gfPop1, gfPop2 ... and call the calendar accordingly with gfPop1.fPopCalendar(...), gfPop2.fPopCalendar(...) in the onclick event handler.
_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
lenkp



Joined: 03 Sep 2007
Posts: 3
Location: Maryland

PostPosted: Mon Sep 17, 2007 8:51 pm    Post subject: re: Trouble with many calendars on one page each using their own agenda Reply with quote

calendarxp wrote:
Since you are using different agenda per calendar, you need to give them different context names, eg. gfPop1, gfPop2 ... and call the calendar accordingly with gfPop1.fPopCalendar(...), gfPop2.fPopCalendar(...) in the onclick event handler.


I tried your suggestion but now none of the calenders pop up. What do you suggest?

Thanks, paul
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Mon Sep 17, 2007 11:00 pm    Post subject: Reply with quote

Do you have an online link for us to test? (You may PM me the link)

Also please check your page in Firefox and see if you got any errors in the "javascript console".

_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Tue Sep 18, 2007 3:18 am    Post subject: Reply with quote

There is something you need to modify in the scripts:
Code:
<script language="Javascript" type="text/javascript">
function SetAgendaName(agenda)
{
// id="gToday:normal:agenda.js:gfPop"
var agenda_name =  'gToday:normal:' + 'agenda_'+ agenda +'.js:gfPop_'+agenda;

if (document.getElementById(agenda_name)!=null)
   return; // because it's already created

// create calendar tag dynamically
var html = '<ifr'+'ame name='+'"'+agenda_name+'"' +'  id="'+agenda_name+'"' +' src="ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;"></ifr'+'ame>';
if (document.all)
  document.body.insertAdjacentHTML('beforeEnd', html);
else {
  var range = document.createRange();
  range.setStartAfter(document.body.lastChild);
  var docFrag = range.createContextualFragment(html);
  document.body.appendChild(docFrag);
     }
alert(html);
}
</script>

Then you need to use "gfPop_<agenda_name>" to call fPopCalendar(). e.g.
Code:
gfPop_safeway.fPopCalendar(...)

_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
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 -> PopCalendarXP 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