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 

Dinamic filling availability for every day in a calendar. Problem with Firefox

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



Joined: 04 May 2007
Posts: 2
Location: Balaguer - Spain

PostPosted: Mon May 07, 2007 9:12 am    Post subject: Dinamic filling availability for every day in a calendar. Problem with Firefox Reply with quote

Hello,
I've developed a solution with the pop & flat calendar. With both solutions, I have the same problem with Firefox (It works fine with IE7+Vista):
I followed the tutorial sample to retrieve agenda events from a backend server, to show dinamicaly information about availability of a resource. I developed a routine who receive a query with the product, year and month, and I return to the calendar the next text:

fAddEvent(2007,6,1,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,2,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,3,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,4,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,5,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,6,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,7,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,8,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,9,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,10,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,11,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,12,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,13,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,14,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,15,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,16,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,17,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,18,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,19,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,20,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,21,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,22,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,23,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,24,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,25,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,26,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,27,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,28,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,29,"NO Disponible","null","red","#FFFFFF","",true,"");fAddEvent(2007,6,30,"NO Disponible","null","red","#FFFFFF","",true,""); if (fRepaint) fRepaint(); // dee ser la ultima linea de la agenda

When I click under the Next/Prvevious buttom, or change the year, the "refresh" function does not work, it show the month I asked for, but the callback to my funcition to obtain new fAddEvents does not work.
If you need the code I used, or you like to connect to a public server to look the problem, don't dubt to ask me for.
Thanks,
David.
Back to top
View user's profile Send private message Visit poster's website
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Mon May 07, 2007 12:49 pm    Post subject: Reply with quote

David,

Did you follow the instruction in the section "Load agenda events per month instead of altogether" of the following tutorial?

http://www.calendarxp.net/tutorials/flat/tutorials/SetupAgendas.htm

If so, could you please attach here the plugins.js you are using? Also, better to post the details of the iframe tag used on your page so that we can reproduce the problem.

It'd be better (faster for us to identify the problem) if you have an online link for us to test - you can PM me if you need to make it private.

_________________
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 May 08, 2007 12:34 pm    Post subject: Reply with quote

David,

In your calendariohotel/plugins.js file, you had the following 3 lines at the bottom:
Code:
//if (gbShareAgenda&&!eval(gsAgShared))
eval(gsAgShared+"=[]");
fLoadEvents(gCurMonth[0],gCurMonth[1]); // load data for the initial month
Could you please uncomment the if statement so that it looks like the following?
Code:
if (gbShareAgenda&&!eval(gsAgShared))
eval(gsAgShared+"=[]");
fLoadEvents(gCurMonth[0],gCurMonth[1]); // load data for the initial month

I think this is the culprit of your trouble.

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



Joined: 04 May 2007
Posts: 2
Location: Balaguer - Spain

PostPosted: Tue May 08, 2007 2:18 pm    Post subject: Firefox / database Reply with quote

I'm sorry, but I changed the plugins.js, I removed the // comment and the trouble continue happening when I'm using Firefox (instead of IE7, who works fine).
Have you any other suggestion?
Thanks,
David.
Back to top
View user's profile Send private message Visit poster's website
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Tue May 08, 2007 8:46 pm    Post subject: Reply with quote

We found the problem - it looks like firefox has changed its behavior against dynamic script loading. The fLoadScript() in the current version can only make FF load once, any subsequent calls will be ignored by FF.

For the time being, I'd suggest you add the following code to plugins.js:
Code:
function sendRequest(url,callback,postData) {
   var req = createXMLHTTPObject();
   if (!req) return;
   var method = (postData) ? "POST" : "GET";
   req.open(method,url,true);
   req.setRequestHeader('User-Agent','XMLHTTP/1.0');
   if (postData)
      req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
   req.onreadystatechange = function () {
      if (req.readyState != 4) return;
      if (req.status != 200 && req.status != 304) {
//         alert('HTTP error ' + req.status);
         return;
      }
      callback(req);
   }
   if (req.readyState == 4) return;
   req.send(postData);
}

var XMLHttpFactories = [
   function () {return new XMLHttpRequest()},
   function () {return new ActiveXObject("Msxml2.XMLHTTP")},
   function () {return new ActiveXObject("Msxml3.XMLHTTP")},
   function () {return new ActiveXObject("Microsoft.XMLHTTP")}
];

function createXMLHTTPObject() {
   var xmlhttp = false;
   for (var i=0;i<XMLHttpFactories.length;i++) {
      try {
         xmlhttp = XMLHttpFactories[i]();
      }
      catch (e) {
         continue;
      }
      break;
   }
   return xmlhttp;
}

function handleRequest(req) {
   eval(req.responseText);
}


Then replace the fLoadScript() with
Code:
sendRequest(url, handleRequest);

_________________
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