PDA

View Full Version : Tons of firebug errors when doing any type of dragging.



bvan
13 Mar 2007, 12:28 PM
Hi,
Thanks in advance to anyone who can help sort this issue out. We are using Yui-ext .40 and have a few web pages utilizing resizeable objects (grids, content panels...etc.) We are also using a drag and drop tree. The problem is the following, anytime we click on a draggable object and begin to move the object on the screen, firebug goes crazy and reports :


r has no properties
http://localhost:7080/assets/frameworks/ext/ext.js
Line 19273

This happens anytime we drag an object on the screen, whether it be a node or content panel divisor. I noticed the bug does not happen when I resize the corners of a BasicDialog box, however.

The problem seems to be located in ScrollManager.js. There is a line where it checks some properties on an element and assigns a variable r to the elements _region. I described r through firebug to see if it has properties when i start dragging, and in fact, it does.

Another error that sometimes intermingles with the "r has no properties", is the following:


els[id].getRegion is not a function
http://localhost:7080/assets/frameworks/ext/ext.js
Line 19371

This error appears in the ScrollManager as well, but under the refreshCache function:


/**
* Manually trigger a cache refresh.
*/
refreshCache : function(){
for(var id in els){
els[id]._region = els[id].getRegion();
}
}

These errors get thrown in firebug for every pixel you drag an element on the screen. Just dragging a content panel divisor slightly to the left can spawn 10 of those "r has no properties" errors.

Can anyone think of why these errors are happening? Any info would be much appreciated.

Thanks!

JeffHowden
13 Mar 2007, 12:35 PM
Upgrade to the latest alpha (alpha 3, rev 4, at the time of this response) and see if you have any issues.

jmakeig
13 Mar 2007, 1:44 PM
I've seen these errors in 1.0 alpha 2 rev 5 as well.

tryanDLS
13 Mar 2007, 2:36 PM
The lastest build is alpha3 rev 4.

wisem
13 Mar 2007, 2:47 PM
I've got a paging grid based upon the supplied example and I've been getting these on every alpha - just upgraded to alpha 3 rev 4 and I'm still seeing them. I've also run the paging grid example from the rev 4 download and it's fine.

jack.slocum
19 Mar 2007, 6:17 AM
Have you extended the Object prototype?

neilweber
20 Mar 2007, 8:49 AM
I see this error too using Ext 1.0 alpha 3. I simply dragged a column splitter in a grid. Here are the stacktraces from Firebug.


els[id].getRegion is not a function
refreshCache()ext-all-debug.js (line 8515)
onFire(Object browserEvent=Event mousemove button=0, false)ext-all-debug.js (line 8435)
apply()ext-yui-adapter.j... (line 8)
handleMouseMove(Object browserEvent=Event mousemove button=0)ext-all-debug.js (line 7590)
h(Object browserEvent=Event mousemove button=0)ext-all-debug.js (line 1500)
wrappedFn(mousemove clientX=0, clientY=0)event-min.js (line 28)
[Break on this error] els[id]._region = els[id].getRegion();


r has no properties
onFire(Object browserEvent=Event mousemove button=0, false)ext-all-debug.js (line 8442)
apply()ext-yui-adapter.j... (line 8)
handleMouseMove(Object browserEvent=Event mousemove button=0)ext-all-debug.js (line 7590)
h(Object browserEvent=Event mousemove button=0)ext-all-debug.js (line 1500)
wrappedFn(mousemove clientX=0, clientY=0)event-min.js (line 28)
[Break on this error] if(r.contains(pt) && el.isScrollable()){

jack.slocum
20 Mar 2007, 10:51 PM
Please see the post above.

bvan
28 Mar 2007, 7:36 AM
Have you extended the Object prototype?

Can you clarify what it means to "extend the Object prototype"?

jack.slocum
3 Apr 2007, 11:37 AM
Even if you have extended the object prototype it should be fixed in the new release.

bobringer
25 Apr 2007, 5:49 PM
Hi Jack,

I'm getting the same thing in 1.0. Fortunately I caught this before I started using any of my object extensions and was able to disable them.

I was adding the following...
Object.prototype.isTime
Object.prototype.isText
Object.prototype.isNumber

These functions were to mirror functions available in Lotus Notes. It's not an issue for me as I am going to come up with another solution for these functions. I just wanted to let you know that there is still an issue here somewhere. Let me know if you would like any additional details.


Bob

oregontarheel
26 Apr 2007, 2:16 PM
I'm also getting this error in my application. I haven't extended the object prototype, but I have extended the String prototype... if that matters... Anyone have any luck stopping these errors?

oregontarheel
26 Apr 2007, 2:17 PM
btw I am using the 1.0 release. Thanks in advance, everyone.

vtswingkid
27 Apr 2007, 8:35 AM
I am using SVN 270 or so (POST ext 1.0). I am getting tones of wtf throws in IE(6+7) when I drag. I see them in an FF other than my development FF too.

I temporarily disabled the debugger that pops up using
Ext.debug.show=Ext.emptyFn;
Ext.debug.log=Ext.emptyFn;
But performance during a drag is suffering a bit now.

cguillot
3 May 2007, 12:46 AM
Hi,
First, thanks a lot for that great work ! =D>

My problem : in some cases in the els array of the ScrollManager some objects don't have any region so i have the message "r has no properties", my solution was to insert a test case in the ScrollManager function onFire (in fact, the same test as in refreshCache function)



var onFire = function(e, isDrop){
...
for(var id in els){
if(typeof(els[id])=='object'){

it seems now to work in 1.0.1a under firefox, but not with my IE7...

So, is it the right solution ? or have i missed something...

jack.slocum
3 May 2007, 2:25 PM
Have you included any code that extends the object prototype?

cguillot
4 May 2007, 3:27 AM
Yes there are some extensions ; one of them is introduced by a json converter script (toJSONString()) ! I guess we should use the json functionnality of Ext ;)

But, more stranger, in the ScrollManegr els object i can also see the extension provided by Ext (extend function with createCallback, createDelegate...)

303

(The toJSONString() extension has been removed).

rmesser
8 May 2007, 2:32 PM
I get the same kind of errors. It does have something to do with extending the object prototype. See this example, which is just the standard array grid example with one extra include:
http://athena.intellisurvey.com/javascript/ext-1.0.1/examples/grid/array-grid2.html

You'll see the "r has no properties" error is generated by the mousemove event when you resize any column.

The extra include is json.js from the json.org site:
http://www.json.org/json.js

That adds the toJSONString function to the object prototype, and seems to somehow conflict with the column resize code.

rmesser
9 May 2007, 11:46 AM
Ok, well upon further investigation I now see that Ext includes the Ext.util.JSON class, which has the same functionality as json.js, just implemented differently to avoid adding to Object.prototype. So switching to that should be easy enough and avoid this issue.

jack.slocum
9 May 2007, 3:43 PM
Ok, well upon further investigation I now see that Ext includes the Ext.util.JSON class, which has the same functionality as json.js, just implemented differently to avoid adding to Object.prototype. So switching to that should be easy enough and avoid this issue.

That's why I moved the JSON code into Ext, specifically to help avoid extending the object prototype. In general we work around extensions of the Object prototype, but not in ScrollManager. I have submitted a change to SVN that should make it safe as well.