Reference Error

View: New views
15 Messages — Rating Filter:   Alert me  

Reference Error

by Florian Schneider-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian

Re: Reference Error

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Have you tried adding the subclass converter alone?

On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian


Re: Reference Error

by Florian Schneider-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian



RE: Reference Error

by mikewse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No, it isn't, and we should be able to get your example working. Could you send along a somewhat larger snippet (10 lines before and after) of the generated code around the line with the error?
Best regards
Mike Wilson


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 10 juni 2009 16:10
To: users@...
Subject: Re: [dwr-user] Reference Error

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian



RE: Reference Error

by mikewse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Specifically look for the definition of SubClass within the generated file. The error seems to indicate it is missing from the file, but normally the class definition and the prototype assignment (the problematic line) go hand in hand, albeit in different parts of the file.


From: Mike Wilson [mailto:mikewse@...]
Sent: den 10 juni 2009 20:57
To: users@...
Subject: RE: [dwr-user] Reference Error

No, it isn't, and we should be able to get your example working. Could you send along a somewhat larger snippet (10 lines before and after) of the generated code around the line with the error?
Best regards
Mike Wilson


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 10 juni 2009 16:10
To: users@...
Subject: Re: [dwr-user] Reference Error

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian



Re: Reference Error

by Florian Schneider-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Mike,

first of all thanks for your help and sorry for the late reply.

I will try to add more meat to my problem description:

What I have is two classes, named Article and MonitoredItem, with Article being the superclass of Monitored item.
The corresponding two lines (defining the converters) inside the dwr.xml look like the following:

<convert match="foo.bar.Article" javascript="Article" converter="bean"/>
<convert match="foo.thing.MonitoredItem" javascript="MonitoredItem" converter="bean"/>

Now one of the js files generated by DWR lets Firefox have the aforementioned exception. I attach the zipped .js file.

I also think that the definition of the subclass is missing but do not fully understand the generated file.

Thanks again for your help,
Florian


2009/6/10 Mike Wilson <mikewse@...>
Specifically look for the definition of SubClass within the generated file. The error seems to indicate it is missing from the file, but normally the class definition and the prototype assignment (the problematic line) go hand in hand, albeit in different parts of the file.


From: Mike Wilson [mailto:mikewse@...]
Sent: den 10 juni 2009 20:57Subject: RE: [dwr-user] Reference Error

No, it isn't, and we should be able to get your example working. Could you send along a somewhat larger snippet (10 lines before and after) of the generated code around the line with the error?
Best regards
Mike Wilson


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 10 juni 2009 16:10
To: users@...
Subject: Re: [dwr-user] Reference Error

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

AircraftSelector.zip (6K) Download Attachment

Re: Reference Error

by Florian Schneider-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, forgot to rename the js file to txt that it passes your mailserver.

2009/6/17 Florian Schneider <flo.schneider@...>
Hello Mike,

first of all thanks for your help and sorry for the late reply.

I will try to add more meat to my problem description:

What I have is two classes, named Article and MonitoredItem, with Article being the superclass of Monitored item.
The corresponding two lines (defining the converters) inside the dwr.xml look like the following:

<convert match="foo.bar.Article" javascript="Article" converter="bean"/>
<convert match="foo.thing.MonitoredItem" javascript="MonitoredItem" converter="bean"/>

Now one of the js files generated by DWR lets Firefox have the aforementioned exception. I attach the zipped .js file.

I also think that the definition of the subclass is missing but do not fully understand the generated file.

Thanks again for your help,
Florian


2009/6/10 Mike Wilson <mikewse@...>

Specifically look for the definition of SubClass within the generated file. The error seems to indicate it is missing from the file, but normally the class definition and the prototype assignment (the problematic line) go hand in hand, albeit in different parts of the file.


From: Mike Wilson [mailto:mikewse@...]
Sent: den 10 juni 2009 20:57Subject: RE: [dwr-user] Reference Error

No, it isn't, and we should be able to get your example working. Could you send along a somewhat larger snippet (10 lines before and after) of the generated code around the line with the error?
Best regards
Mike Wilson


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 10 juni 2009 16:10
To: users@...
Subject: Re: [dwr-user] Reference Error

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

AircraftSelector.zip (6K) Download Attachment

RE: Reference Error

by mikewse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I loaded your generated file (through a simple html file with a script tag) and it works fine for me in Firefox with FireBug:
>>> obj = new MonitoredItem
>>> obj instanceof MonitoredItem
true
>>> obj instanceof Article
true
What browser version are you using? Or are you including the file in some other way than with a script tag?
 
Best regarde
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 17 juni 2009 16:33
To: users@...
Subject: Re: [dwr-user] Reference Error

Hello Mike,

first of all thanks for your help and sorry for the late reply.

I will try to add more meat to my problem description:

What I have is two classes, named Article and MonitoredItem, with Article being the superclass of Monitored item.
The corresponding two lines (defining the converters) inside the dwr.xml look like the following:

<convert match="foo.bar.Article" javascript="Article" converter="bean"/>
<convert match="foo.thing.MonitoredItem" javascript="MonitoredItem" converter="bean"/>

Now one of the js files generated by DWR lets Firefox have the aforementioned exception. I attach the zipped .js file.

I also think that the definition of the subclass is missing but do not fully understand the generated file.

Thanks again for your help,
Florian


2009/6/10 Mike Wilson <mikewse@...>
Specifically look for the definition of SubClass within the generated file. The error seems to indicate it is missing from the file, but normally the class definition and the prototype assignment (the problematic line) go hand in hand, albeit in different parts of the file.


From: Mike Wilson [mailto:mikewse@...]
Sent: den 10 juni 2009 20:57 Subject: RE: [dwr-user] Reference Error

No, it isn't, and we should be able to get your example working. Could you send along a somewhat larger snippet (10 lines before and after) of the generated code around the line with the error?
Best regards
Mike Wilson


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 10 juni 2009 16:10
To: users@...
Subject: Re: [dwr-user] Reference Error

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian




Re: Reference Error

by Florian Schneider-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We want to access the DWR interface out of a Dojo widget, so I use dojo.require("dwr.interface.AircraftSelector");

I am using Firefox 3.0.11 .

Best regards,
Florian


2009/6/17 Mike Wilson <mikewse@...>
I loaded your generated file (through a simple html file with a script tag) and it works fine for me in Firefox with FireBug:
>>> obj = new MonitoredItem
>>> obj instanceof MonitoredItem
true
>>> obj instanceof Article
true
What browser version are you using? Or are you including the file in some other way than with a script tag?
 
Best regarde
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 17 juni 2009 16:33

To: users@...
Subject: Re: [dwr-user] Reference Error

Hello Mike,

first of all thanks for your help and sorry for the late reply.

I will try to add more meat to my problem description:

What I have is two classes, named Article and MonitoredItem, with Article being the superclass of Monitored item.
The corresponding two lines (defining the converters) inside the dwr.xml look like the following:

<convert match="foo.bar.Article" javascript="Article" converter="bean"/>
<convert match="foo.thing.MonitoredItem" javascript="MonitoredItem" converter="bean"/>

Now one of the js files generated by DWR lets Firefox have the aforementioned exception. I attach the zipped .js file.

I also think that the definition of the subclass is missing but do not fully understand the generated file.

Thanks again for your help,
Florian


2009/6/10 Mike Wilson <mikewse@...>
Specifically look for the definition of SubClass within the generated file. The error seems to indicate it is missing from the file, but normally the class definition and the prototype assignment (the problematic line) go hand in hand, albeit in different parts of the file.


From: Mike Wilson [mailto:mikewse@...]
Sent: den 10 juni 2009 20:57 Subject: RE: [dwr-user] Reference Error

No, it isn't, and we should be able to get your example working. Could you send along a somewhat larger snippet (10 lines before and after) of the generated code around the line with the error?
Best regards
Mike Wilson


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 10 juni 2009 16:10
To: users@...
Subject: Re: [dwr-user] Reference Error

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian





RE: Reference Error

by mikewse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, apparently the inclusion through Dojo changes context a bit as |this| is set to Dojo instead of to the global object (typically window), and we use |this| in our generated files.
I'd like to fix this, but that means DWR should avoid all usage of |this| on global level in generated files.
Joe: you added the |this| code style for 3.0 (for other reasons); are you ok with going back to the non-prefixed code style to resolve this issue? (I e MonitoredItem=... instead of this.MonitoredItem=...)
 
Best regards
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 19 juni 2009 14:48
To: users@...
Subject: Re: [dwr-user] Reference Error

We want to access the DWR interface out of a Dojo widget, so I use dojo.require("dwr.interface.AircraftSelector");

I am using Firefox 3.0.11 .

Best regards,
Florian


2009/6/17 Mike Wilson <mikewse@...>
I loaded your generated file (through a simple html file with a script tag) and it works fine for me in Firefox with FireBug:
>>> obj = new MonitoredItem
>>> obj instanceof MonitoredItem
true
>>> obj instanceof Article
true
What browser version are you using? Or are you including the file in some other way than with a script tag?
 
Best regarde
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 17 juni 2009 16:33

To: users@...
Subject: Re: [dwr-user] Reference Error

Hello Mike,

first of all thanks for your help and sorry for the late reply.

I will try to add more meat to my problem description:

What I have is two classes, named Article and MonitoredItem, with Article being the superclass of Monitored item.
The corresponding two lines (defining the converters) inside the dwr.xml look like the following:

<convert match="foo.bar.Article" javascript="Article" converter="bean"/>
<convert match="foo.thing.MonitoredItem" javascript="MonitoredItem" converter="bean"/>

Now one of the js files generated by DWR lets Firefox have the aforementioned exception. I attach the zipped .js file.

I also think that the definition of the subclass is missing but do not fully understand the generated file.

Thanks again for your help,
Florian


2009/6/10 Mike Wilson <mikewse@...>
Specifically look for the definition of SubClass within the generated file. The error seems to indicate it is missing from the file, but normally the class definition and the prototype assignment (the problematic line) go hand in hand, albeit in different parts of the file.


From: Mike Wilson [mailto:mikewse@...]
Sent: den 10 juni 2009 20:57 Subject: RE: [dwr-user] Reference Error

No, it isn't, and we should be able to get your example working. Could you send along a somewhat larger snippet (10 lines before and after) of the generated code around the line with the error?
Best regards
Mike Wilson


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 10 juni 2009 16:10
To: users@...
Subject: Re: [dwr-user] Reference Error

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian





Re: Reference Error

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Probably we should just add a dojo.hitch in there

On Sun, Jun 21, 2009 at 8:36 PM, Mike Wilson <mikewse@...> wrote:
Yes, apparently the inclusion through Dojo changes context a bit as |this| is set to Dojo instead of to the global object (typically window), and we use |this| in our generated files.
I'd like to fix this, but that means DWR should avoid all usage of |this| on global level in generated files.
Joe: you added the |this| code style for 3.0 (for other reasons); are you ok with going back to the non-prefixed code style to resolve this issue? (I e MonitoredItem=... instead of this.MonitoredItem=...)
 
Best regards
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 19 juni 2009 14:48

To: users@...
Subject: Re: [dwr-user] Reference Error

We want to access the DWR interface out of a Dojo widget, so I use dojo.require("dwr.interface.AircraftSelector");

I am using Firefox 3.0.11 .

Best regards,
Florian


2009/6/17 Mike Wilson <mikewse@...>
I loaded your generated file (through a simple html file with a script tag) and it works fine for me in Firefox with FireBug:
>>> obj = new MonitoredItem
>>> obj instanceof MonitoredItem
true
>>> obj instanceof Article
true
What browser version are you using? Or are you including the file in some other way than with a script tag?
 
Best regarde
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 17 juni 2009 16:33

To: users@...
Subject: Re: [dwr-user] Reference Error

Hello Mike,

first of all thanks for your help and sorry for the late reply.

I will try to add more meat to my problem description:

What I have is two classes, named Article and MonitoredItem, with Article being the superclass of Monitored item.
The corresponding two lines (defining the converters) inside the dwr.xml look like the following:

<convert match="foo.bar.Article" javascript="Article" converter="bean"/>
<convert match="foo.thing.MonitoredItem" javascript="MonitoredItem" converter="bean"/>

Now one of the js files generated by DWR lets Firefox have the aforementioned exception. I attach the zipped .js file.

I also think that the definition of the subclass is missing but do not fully understand the generated file.

Thanks again for your help,
Florian


2009/6/10 Mike Wilson <mikewse@...>
Specifically look for the definition of SubClass within the generated file. The error seems to indicate it is missing from the file, but normally the class definition and the prototype assignment (the problematic line) go hand in hand, albeit in different parts of the file.


From: Mike Wilson [mailto:mikewse@...]
Sent: den 10 juni 2009 20:57 Subject: RE: [dwr-user] Reference Error

No, it isn't, and we should be able to get your example working. Could you send along a somewhat larger snippet (10 lines before and after) of the generated code around the line with the error?
Best regards
Mike Wilson


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 10 juni 2009 16:10
To: users@...
Subject: Re: [dwr-user] Reference Error

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian






Re: Reference Error

by Joe Walker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Totally.
Joe.

2009/6/21 Mike Wilson <mikewse@...>
Yes, apparently the inclusion through Dojo changes context a bit as |this| is set to Dojo instead of to the global object (typically window), and we use |this| in our generated files.
I'd like to fix this, but that means DWR should avoid all usage of |this| on global level in generated files.
Joe: you added the |this| code style for 3.0 (for other reasons); are you ok with going back to the non-prefixed code style to resolve this issue? (I e MonitoredItem=... instead of this.MonitoredItem=...)
 
Best regards
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 19 juni 2009 14:48

To: users@...
Subject: Re: [dwr-user] Reference Error

We want to access the DWR interface out of a Dojo widget, so I use dojo.require("dwr.interface.AircraftSelector");

I am using Firefox 3.0.11 .

Best regards,
Florian


2009/6/17 Mike Wilson <mikewse@...>
I loaded your generated file (through a simple html file with a script tag) and it works fine for me in Firefox with FireBug:
>>> obj = new MonitoredItem
>>> obj instanceof MonitoredItem
true
>>> obj instanceof Article
true
What browser version are you using? Or are you including the file in some other way than with a script tag?
 
Best regarde
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 17 juni 2009 16:33

To: users@...
Subject: Re: [dwr-user] Reference Error

Hello Mike,

first of all thanks for your help and sorry for the late reply.

I will try to add more meat to my problem description:

What I have is two classes, named Article and MonitoredItem, with Article being the superclass of Monitored item.
The corresponding two lines (defining the converters) inside the dwr.xml look like the following:

<convert match="foo.bar.Article" javascript="Article" converter="bean"/>
<convert match="foo.thing.MonitoredItem" javascript="MonitoredItem" converter="bean"/>

Now one of the js files generated by DWR lets Firefox have the aforementioned exception. I attach the zipped .js file.

I also think that the definition of the subclass is missing but do not fully understand the generated file.

Thanks again for your help,
Florian


2009/6/10 Mike Wilson <mikewse@...>
Specifically look for the definition of SubClass within the generated file. The error seems to indicate it is missing from the file, but normally the class definition and the prototype assignment (the problematic line) go hand in hand, albeit in different parts of the file.


From: Mike Wilson [mailto:mikewse@...]
Sent: den 10 juni 2009 20:57 Subject: RE: [dwr-user] Reference Error

No, it isn't, and we should be able to get your example working. Could you send along a somewhat larger snippet (10 lines before and after) of the generated code around the line with the error?
Best regards
Mike Wilson


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 10 juni 2009 16:10
To: users@...
Subject: Re: [dwr-user] Reference Error

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian






RE: Reference Error

by mikewse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Great - I have now checked in the changes.
 
Florian: If you don't mind building DWR yourself you can now get a fixed version from our SVN repo. Otherwise wait for the RC2 release.
 
Best regards
Mike


From: joseph.walker@... [mailto:joseph.walker@...] On Behalf Of Joe Walker
Sent: den 22 juni 2009 13:30
To: users
Subject: Re: [dwr-user] Reference Error


Totally.
Joe.

2009/6/21 Mike Wilson <mikewse@...>
Yes, apparently the inclusion through Dojo changes context a bit as |this| is set to Dojo instead of to the global object (typically window), and we use |this| in our generated files.
I'd like to fix this, but that means DWR should avoid all usage of |this| on global level in generated files.
Joe: you added the |this| code style for 3.0 (for other reasons); are you ok with going back to the non-prefixed code style to resolve this issue? (I e MonitoredItem=... instead of this.MonitoredItem=...)
 
Best regards
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 19 juni 2009 14:48

To: users@...
Subject: Re: [dwr-user] Reference Error

We want to access the DWR interface out of a Dojo widget, so I use dojo.require("dwr.interface.AircraftSelector");

I am using Firefox 3.0.11 .

Best regards,
Florian


2009/6/17 Mike Wilson <mikewse@...>
I loaded your generated file (through a simple html file with a script tag) and it works fine for me in Firefox with FireBug:
>>> obj = new MonitoredItem
>>> obj instanceof MonitoredItem
true
>>> obj instanceof Article
true
What browser version are you using? Or are you including the file in some other way than with a script tag?
 
Best regarde
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 17 juni 2009 16:33

To: users@...
Subject: Re: [dwr-user] Reference Error

Hello Mike,

first of all thanks for your help and sorry for the late reply.

I will try to add more meat to my problem description:

What I have is two classes, named Article and MonitoredItem, with Article being the superclass of Monitored item.
The corresponding two lines (defining the converters) inside the dwr.xml look like the following:

<convert match="foo.bar.Article" javascript="Article" converter="bean"/>
<convert match="foo.thing.MonitoredItem" javascript="MonitoredItem" converter="bean"/>

Now one of the js files generated by DWR lets Firefox have the aforementioned exception. I attach the zipped .js file.

I also think that the definition of the subclass is missing but do not fully understand the generated file.

Thanks again for your help,
Florian


2009/6/10 Mike Wilson <mikewse@...>
Specifically look for the definition of SubClass within the generated file. The error seems to indicate it is missing from the file, but normally the class definition and the prototype assignment (the problematic line) go hand in hand, albeit in different parts of the file.


From: Mike Wilson [mailto:mikewse@...]
Sent: den 10 juni 2009 20:57 Subject: RE: [dwr-user] Reference Error

No, it isn't, and we should be able to get your example working. Could you send along a somewhat larger snippet (10 lines before and after) of the generated code around the line with the error?
Best regards
Mike Wilson


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 10 juni 2009 16:10
To: users@...
Subject: Re: [dwr-user] Reference Error

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian






Re: Reference Error

by Florian Schneider-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Great!!! Thank you very much :-)

2009/6/22 Mike Wilson <mikewse@...>
Great - I have now checked in the changes.
 
Florian: If you don't mind building DWR yourself you can now get a fixed version from our SVN repo. Otherwise wait for the RC2 release.
 
Best regards
Mike


From: joseph.walker@... [mailto:joseph.walker@...] On Behalf Of Joe Walker
Sent: den 22 juni 2009 13:30
To: users

Subject: Re: [dwr-user] Reference Error


Totally.
Joe.

2009/6/21 Mike Wilson <mikewse@...>
Yes, apparently the inclusion through Dojo changes context a bit as |this| is set to Dojo instead of to the global object (typically window), and we use |this| in our generated files.
I'd like to fix this, but that means DWR should avoid all usage of |this| on global level in generated files.
Joe: you added the |this| code style for 3.0 (for other reasons); are you ok with going back to the non-prefixed code style to resolve this issue? (I e MonitoredItem=... instead of this.MonitoredItem=...)
 
Best regards
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 19 juni 2009 14:48

To: users@...
Subject: Re: [dwr-user] Reference Error

We want to access the DWR interface out of a Dojo widget, so I use dojo.require("dwr.interface.AircraftSelector");

I am using Firefox 3.0.11 .

Best regards,
Florian


2009/6/17 Mike Wilson <mikewse@...>
I loaded your generated file (through a simple html file with a script tag) and it works fine for me in Firefox with FireBug:
>>> obj = new MonitoredItem
>>> obj instanceof MonitoredItem
true
>>> obj instanceof Article
true
What browser version are you using? Or are you including the file in some other way than with a script tag?
 
Best regarde
Mike


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 17 juni 2009 16:33

To: users@...
Subject: Re: [dwr-user] Reference Error

Hello Mike,

first of all thanks for your help and sorry for the late reply.

I will try to add more meat to my problem description:

What I have is two classes, named Article and MonitoredItem, with Article being the superclass of Monitored item.
The corresponding two lines (defining the converters) inside the dwr.xml look like the following:

<convert match="foo.bar.Article" javascript="Article" converter="bean"/>
<convert match="foo.thing.MonitoredItem" javascript="MonitoredItem" converter="bean"/>

Now one of the js files generated by DWR lets Firefox have the aforementioned exception. I attach the zipped .js file.

I also think that the definition of the subclass is missing but do not fully understand the generated file.

Thanks again for your help,
Florian


2009/6/10 Mike Wilson <mikewse@...>
Specifically look for the definition of SubClass within the generated file. The error seems to indicate it is missing from the file, but normally the class definition and the prototype assignment (the problematic line) go hand in hand, albeit in different parts of the file.


From: Mike Wilson [mailto:mikewse@...]
Sent: den 10 juni 2009 20:57 Subject: RE: [dwr-user] Reference Error

No, it isn't, and we should be able to get your example working. Could you send along a somewhat larger snippet (10 lines before and after) of the generated code around the line with the error?
Best regards
Mike Wilson


From: Florian Schneider [mailto:flo.schneider@...]
Sent: den 10 juni 2009 16:10
To: users@...
Subject: Re: [dwr-user] Reference Error

Adding the subclass converter alone does work.
So is this a common practice NOT to include superclasses of classes already known to DWR?

2009/6/10 Jose Noheda <jose.noheda@...>
Have you tried adding the subclass converter alone?


On Wed, Jun 10, 2009 at 3:27 PM, Florian Schneider <flo.schneider@...> wrote:
Hello,

when I add the following lines to my dwr.xml

<convert match="foo.bar.SuperClass" javascript="SuperClass" converter="bean"/>
<convert match="foo.bar.SubClass" javascript="SubClass" converter="bean"/>

where SuperClass is the SuperClass of SubClass, I see the following error in my Firebug console:

"ReferenceError: SubClass is not defined"

, referencing the line in the generated js (one of the files that have creators defined)

SubClass.prototype = new SuperClass();

Please excuse my blindness, but what am I doing wrong? I am using DWR 3.0rc1.

Thanks for your help,
Florian







Re: Reference Error

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for taking care of this Mike.

Mike Wilson wrote:

> Great - I have now checked in the changes.
>  
> Florian: If you don't mind building DWR yourself you can now get a
> fixed version from our SVN repo. Otherwise wait for the RC2 release.
>  
> Best regards
> Mike
>
>     ------------------------------------------------------------------------
>     *From:* joseph.walker@... [mailto:joseph.walker@...]
>     *On Behalf Of *Joe Walker
>     *Sent:* den 22 juni 2009 13:30
>     *To:* users
>     *Subject:* Re: [dwr-user] Reference Error
>
>
>     Totally.
>     Joe.
>
>     2009/6/21 Mike Wilson <mikewse@...
>     <mailto:mikewse@...>>
>
>         Yes, apparently the inclusion through Dojo changes context a
>         bit as |this| is set to Dojo instead of to the global object
>         (typically window), and we use |this| in our generated files.
>         I'd like to fix this, but that means DWR should avoid all
>         usage of |this| on global level in generated files.
>         Joe: you added the |this| code style for 3.0 (for other
>         reasons); are you ok with going back to the non-prefixed code
>         style to resolve this issue? (I e MonitoredItem=... instead of
>         this.MonitoredItem=...)
>          
>         Best regards
>         Mike
>
>             ------------------------------------------------------------------------
>             *From:* Florian Schneider [mailto:flo.schneider@...
>             <mailto:flo.schneider@...>]
>             *Sent:* den 19 juni 2009 14:48
>
>             *To:* users@... <mailto:users@...>
>             *Subject:* Re: [dwr-user] Reference Error
>
>             We want to access the DWR interface out of a Dojo widget,
>             so I use dojo.require("dwr.interface.AircraftSelector");
>
>             I am using Firefox 3.0.11 .
>
>             Best regards,
>             Florian
>
>
>             2009/6/17 Mike Wilson <mikewse@...
>             <mailto:mikewse@...>>
>
>                 I loaded your generated file (through a simple html
>                 file with a script tag) and it works fine for me in
>                 Firefox with FireBug:
>
>                     >>> obj = new MonitoredItem
>                     Object external=false materialTypeKey=0
>                     >>> obj instanceof MonitoredItem
>                     true
>                     >>> obj instanceof Article
>                     true
>
>                 What browser version are you using? Or are you including the file in some other way
>                 than with a script tag?
>                  
>                 Best regarde
>                 Mike
>
>                     ------------------------------------------------------------------------
>                     *From:* Florian Schneider
>                     [mailto:flo.schneider@...
>                     <mailto:flo.schneider@...>]
>                     *Sent:* den 17 juni 2009 16:33
>
>                     *To:* users@...
>                     <mailto:users@...>
>                     *Subject:* Re: [dwr-user] Reference Error
>
>                     Hello Mike,
>
>                     first of all thanks for your help and sorry for
>                     the late reply.
>
>                     I will try to add more meat to my problem description:
>
>                     What I have is two classes, named Article and
>                     MonitoredItem, with Article being the superclass
>                     of Monitored item.
>                     The corresponding two lines (defining the
>                     converters) inside the dwr.xml look like the
>                     following:
>
>                     <convert match="foo.bar.Article"
>                     javascript="Article" converter="bean"/>
>                     <convert match="foo.thing.MonitoredItem"
>                     javascript="MonitoredItem" converter="bean"/>
>
>                     Now one of the js files generated by DWR lets
>                     Firefox have the aforementioned exception. I
>                     attach the zipped .js file.
>
>                     I also think that the definition of the subclass
>                     is missing but do not fully understand the
>                     generated file.
>
>                     Thanks again for your help,
>                     Florian
>
>
>                     2009/6/10 Mike Wilson <mikewse@...
>                     <mailto:mikewse@...>>
>
>                         Specifically look for the definition of
>                         SubClass within the generated file. The error
>                         seems to indicate it is missing from the file,
>                         but normally the class definition and the
>                         prototype assignment (the problematic line) go
>                         hand in hand, albeit in different parts of the
>                         file.
>
>                             ------------------------------------------------------------------------
>                             *From:* Mike Wilson
>                             [mailto:mikewse@...
>                             <mailto:mikewse@...>]
>                             *Sent:* den 10 juni 2009 20:57
>
>                             *To:* users@...
>                             <mailto:users@...>
>                             *Subject:* RE: [dwr-user] Reference Error
>
>                             No, it isn't, and we should be able to get
>                             your example working. Could you send along
>                             a somewhat larger snippet (10 lines before
>                             and after) of the generated code around
>                             the line with the error?
>                             Best regards
>                             Mike Wilson
>
>                                 ------------------------------------------------------------------------
>                                 *From:* Florian Schneider
>                                 [mailto:flo.schneider@...
>                                 <mailto:flo.schneider@...>]
>                                 *Sent:* den 10 juni 2009 16:10
>                                 *To:* users@...
>                                 <mailto:users@...>
>                                 *Subject:* Re: [dwr-user] Reference Error
>
>                                 Adding the subclass converter alone
>                                 does work.
>                                 So is this a common practice NOT to
>                                 include superclasses of classes
>                                 already known to DWR?
>
>                                 2009/6/10 Jose Noheda
>                                 <jose.noheda@...
>                                 <mailto:jose.noheda@...>>
>
>                                     Have you tried adding the subclass
>                                     converter alone?
>
>
>                                     On Wed, Jun 10, 2009 at 3:27 PM,
>                                     Florian Schneider
>                                     <flo.schneider@...
>                                     <mailto:flo.schneider@...>>
>                                     wrote:
>
>                                         Hello,
>
>                                         when I add the following lines
>                                         to my dwr.xml
>
>                                         <convert
>                                         match="foo.bar.SuperClass"
>                                         javascript="SuperClass"
>                                         converter="bean"/>
>                                         <convert
>                                         match="foo.bar.SubClass"
>                                         javascript="SubClass"
>                                         converter="bean"/>
>
>                                         where SuperClass is the
>                                         SuperClass of SubClass, I see
>                                         the following error in my
>                                         Firebug console:
>
>                                         "ReferenceError: SubClass is
>                                         not defined"
>
>                                         , referencing the line in the
>                                         generated js (one of the files
>                                         that have creators defined)
>
>                                         SubClass.prototype = new
>                                         SuperClass();
>
>                                         Please excuse my blindness,
>                                         but what am I doing wrong? I
>                                         am using DWR 3.0rc1.
>
>                                         Thanks for your help,
>                                         Florian
>
>
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...