gslender / ofcgwt

Automatically exported from code.google.com/p/ofcgwt
0 stars 0 forks source link

random javascript exception "Object doesn't support this property or method" #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using thr latest ofcgwt from subversion (rev 118, i believe). I am 
running on windows vista.

I have an application which starts up and then immediately updates several 
charts.  The charts are then updated with a frequency which is set by the 
application (5 seconds, presently).

I randomly get a native exception (shown below).  This exeption only 
occurs when the application starts up - if the exception doesn't occur at 
startup, then the application will run smoothly (always).

I'm wondering if the problem is that there is a javascript call to update 
the chart before the chart swf file is fully loaded.  If this is the case, 
I wonder if we can use a preloader from gwt to make sure that the swf file 
is always fully loaded (thoughts?).

Otherwise, I suppose that I need to catch this exception and just try to 
update the chart again.

I can work to create a stripped down test case if this would help you.
__________________________________________________________
     com.google.gwt.core.client.JavaScriptException: (TypeError): Object 
doesn't support this property or method
      number: -2146827850
      description: Object doesn't support this property or method
    at com.rednels.ofcgwt.client.ChartWidget.loadJSON(Native Method)
    at com.rednels.ofcgwt.client.ChartWidget.setJsonData
(ChartWidget.java:288)
        etc.

Original issue reported on code.google.com by john.m.s...@gmail.com on 7 Jan 2009 at 2:52

GoogleCodeExporter commented 9 years ago
yep, pls post a sample app/test that demonstrates the problem.

Original comment by gslen...@gmail.com on 7 Jan 2009 at 9:30

GoogleCodeExporter commented 9 years ago

Original comment by gslen...@gmail.com on 7 Jan 2009 at 9:30

GoogleCodeExporter commented 9 years ago
Ok, I've attached an example.  It shows pretty clearly that the error shows up 
if 
the chart data is set before the module load is complete.

I can code around this even though this call is buried further down in my code 
... 
not as simple as the example.

This having been said, what do you think about throwing a more legible 
exception if 
this function is called before the widget is loaded? e.g. overload the 'onLoad' 
function of the chart widget to set a flag that the widget has been loaded.  If 
the 'setJsonData' is called before the chart widget is loaded, then you throw a 
legible exception.

Thanks for your help!

Original comment by john.m.s...@gmail.com on 8 Jan 2009 at 12:51

Attachments:

GoogleCodeExporter commented 9 years ago
v1.2.4 contains fix. solution was to simply fix the JSNI method to check before
calling if the flash obj was ready or not. tested ok

Original comment by gslen...@gmail.com on 8 Jan 2009 at 1:29

GoogleCodeExporter commented 9 years ago
I tested it as well ... works great! Thanks!!

Original comment by john.m.s...@gmail.com on 8 Jan 2009 at 1:57

GoogleCodeExporter commented 9 years ago

Original comment by gslen...@gmail.com on 9 Jan 2009 at 5:08