YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub
  [ 27 posts ] Go to page Previous1, 2, 3 Next

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 691
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • YUI Developer
  • Offline
  • Profile

Re: Array in Formatter throws an error "Null or not an object"

Post Posted: Sat Nov 28, 2009 10:51 am
+0-
IE is well known for excessive caching, I find that the following headers on the server side help discourage IE:

header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Content-type: application/json; charset=utf-8');

The last one is just for JSON data. This usually convinces IE not to cache the information.

Io Valduc

  • Username: Valduc
  • Joined: Fri Nov 27, 2009 5:19 pm
  • Posts: 19
  • Location: Knokke-Heist (Belgium)
  • Offline
  • Profile

Re: Array in Formatter throws an error "Null or not an object"

Post Posted: Sat Nov 28, 2009 12:22 pm
+0-
Yes, correct.

But concerning: header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1

I tried this already, but it did not change the behavior of MSIE.

PLUS:
If I use this header in Firefox it messes up the unset of some session variables.

IF I log out with:
unset($_session['user']) // (example)
header('location: somepage.html');

THEN pushing on the back button of FF will get me back on the session-protected page... (that is the page where I logged out from.)

This is the log out function I use
Code:
// logout the user
function userLogOut(){
   unset($_SESSION['loggedin']);
   header("location: ".ROOT_URL."/index.html");
}


And this is the function I use to set the session (on boot of the page)

Code:
function initSession(){
   ini_set("session.use_trans_sid", false);
   ini_set('url_rewriter.tags', '');
   $time = 3600;
   session_set_cookie_params($time);
   // start session
   session_start();
   session_regenerate_id(); //delete_old_session
   $newSession = session_id();
    session_write_close();
    session_id($newSession);
    session_start();
   //
}


ps: but of course that is a completely different discussion...

UPDATE:
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
this seems to do the trick in FF...

Io Valduc

  • Username: Valduc
  • Joined: Fri Nov 27, 2009 5:19 pm
  • Posts: 19
  • Location: Knokke-Heist (Belgium)
  • Offline
  • Profile

Re: Array in Formatter throws an error "Null or not an object"

Post Posted: Sat Nov 28, 2009 12:38 pm
+0-
Is it safe to assume that if I want to use YUI in a production environment that users must be encouraged to use FF, Safari, whatever, as long as it isn't MSIE?

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 691
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • YUI Developer
  • Offline
  • Profile
Tags:

Re: Array in Formatter throws an error "Null or not an object"

Post Posted: Sat Nov 28, 2009 12:56 pm
+0-
No, not at all. YAHOO uses YUI on its own site and its open to every sort of browser. You have some problem somewhere which is not evident in the segments of code you show, much less without formatting.

Io Valduc

  • Username: Valduc
  • Joined: Fri Nov 27, 2009 5:19 pm
  • Posts: 19
  • Location: Knokke-Heist (Belgium)
  • Offline
  • Profile
Tags:

Re: Array in Formatter throws an error "Null or not an object"

Post Posted: Sat Nov 28, 2009 2:30 pm
+0-
The complete code of the page with the datatable is here:
http://pastie.org/pastes/718378

Io Valduc

  • Username: Valduc
  • Joined: Fri Nov 27, 2009 5:19 pm
  • Posts: 19
  • Location: Knokke-Heist (Belgium)
  • Offline
  • Profile

Re: Array in Formatter throws an error "Null or not an object"

Post Posted: Sat Nov 28, 2009 2:55 pm
+0-
Could the problem be timing related?
Maybe the loading sequence is different between browsers.

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 691
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • YUI Developer
  • Offline
  • Profile

Re: Array in Formatter throws an error "Null or not an object"

Post Posted: Sat Nov 28, 2009 11:44 pm
+0-
I was about to suggest the same. Seeing all the calls to asyncRequest I believe so, that would also explain why sometimes it works in IE, when the reply is cached, the timing is completely altered. Use the logger utility to show you what happens when and see if that fits with what you meant. You won't be able to use breakpoints or alert boxes to find out because that would also alter the timing.

Io Valduc

  • Username: Valduc
  • Joined: Fri Nov 27, 2009 5:19 pm
  • Posts: 19
  • Location: Knokke-Heist (Belgium)
  • Offline
  • Profile

Re: Array in Formatter throws an error "Null or not an object"

Post Posted: Sun Nov 29, 2009 11:30 am
+0-
I think I have found the trigger of the problem, but I don't know how to solve it yet.

With YAHOO.log I have noticed a variation in timing between the formatter and my custom DropdownCellEditor (of the same key).
In Safari and FF the custom editor mostly triggers first, but sometimes (1/20) the browser reacts like Explorer by loading eternally (MSIE always triggers the formatter first).

This is the LOG on succes (bottom to top):

Code:
INFO 108ms (+0) 20:36:20 GMT+01:00:
global
listofusers[posnum].label in formatter: Verified users
INFO 108ms (+0) 20:36:20 GMT+01:00:
global
posnum in formatter: 2
INFO 108ms (+0) 20:36:20 GMT+01:00:
global
listofusers[posnum].label in formatter: Everybody
INFO 108ms (+22) 20:36:20 GMT+01:00:
global
posnum in formatter: 0
INFO 86ms (+65) 20:36:20 GMT+01:00:
global
listofusers[0].label in Custom Editor : Everybody
INFO 21ms (+21) 20:36:20 GMT+01:00:
LogReader  instance0
LogReader initialized
INFO 0ms (+0) 20:36:20 GMT+01:00:
global
Logger initialized



This is the LOG on failure:

Code:
INFO 142ms (+26) 20:35:28 GMT+01:00:
global
listofusers[0].label in Custom Editor : Everybody
INFO 116ms (+89) 20:35:28 GMT+01:00:
global
posnum in formatter: 0
INFO 27ms (+27) 20:35:28 GMT+01:00:
LogReader  instance0
LogReader initialized
INFO 0ms (+0) 20:35:28 GMT+01:00:
global
Logger initialized

Io Valduc

  • Username: Valduc
  • Joined: Fri Nov 27, 2009 5:19 pm
  • Posts: 19
  • Location: Knokke-Heist (Belgium)
  • Offline
  • Profile

Re: Array in Formatter throws an error "Null or not an object"

Post Posted: Sun Nov 29, 2009 1:36 pm
+0-
By the way:

Does anybody knows what this error (in JSLint) means:

Implied global: YAHOO 1,3,43,45,49,56,61,88,90,95,98,107,112,155,158,159,160,171,177,182,212,219,224,260,262,283,290,295,317,322,332,333,342,419,428,441,470, escape 14,76,127,197,239,310, alert 65,70,116,121,186,191,228,233,299,304,451

Kai Schwarz

  • Username: papakai
  • Joined: Fri Nov 13, 2009 8:26 am
  • Posts: 64
  • Location: Germany
  • Offline
  • Profile

Re: Array in Formatter throws an error "Null or not an object"

Post Posted: Sun Nov 29, 2009 1:57 pm
+0-
that you have variable YAHOO as a global variable in your code. its not an error...
  [ 27 posts ] Go to page Previous1, 2, 3 Next
Display posts from previous:  Sort by  
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