"x is not a constructor" error using XML record definitions [message #814821] |
Tue, 06 March 2012 23:16 |
Dan Darnell Messages: 145 Registered: November 2011 Location: Arkansas |
Senior Member |
|
|
I'm using 0.8 M2.
I have a simple Rich UI app that consumes a third-party web service. There are a bunch of records that together define the XML document structure required as a parameter to the service. With the records defined in a separate source part from my Rich UI handler the service invocation fails with the following (in an external browser):
CRRUI1083E] An error occurred while the click browser event was being handled.
[CRRUI2002E] onClick_serviceCallButton
An error occurred inside TestUPSServiceCall: egl.com.dandarnell.server.AccessRequest is not a constructor
[CRRUI2094E] Here are the EGL function calls leading to this error:
TestUPSServiceCall.onClick_serviceCallButton() [native JavaScript]
In preview mode the error is slightly different:
[CRRUI1083E] An error occurred while the click browser event was being handled.
[CRRUI2002E] onClick_serviceCallButton
An error occurred inside TestUPSServiceCall: Object expected
[CRRUI2094E] Here are the EGL function calls leading to this error:
TestUPSServiceCall.onClick_serviceCallButton() [native JavaScript]
Here's one of the records that acts as an XML document definition (this one actually stands by itself):
record AccessRequest
lang string{@XMLAttribute{}};
accessLicenseNumber string{@XMLElement{name = "AccessLicenseNumber"}};
userId string{@XMLElement{name = "UserId"}};
password string{@XMLElement{name = "Password"}};
end
The failure occurs way before the service invocation -- it happens when I do the following in my Rich UI handler:
security AccessRequest {lang = "en-US",
accessLicenseNumber = Properties.upsAccessKey,
userId = Properties.upsUserID,
password = Properties.upsPassword };
(Note: It doesn't make a difference whether or not I use properties. Hardcoding the values results in the same error.)
If I put the record definitions in the SAME source part as the handler, everything works fine -- no errors.
Before I submit a bug, am I doing something wrong? If it is a bug, is it a known problem?
--Dan
[Updated on: Tue, 06 March 2012 23:17] Report message to a moderator
|
|
|
Re: "x is not a constructor" error using XML record definitions [message #815475 is a reply to message #814821] |
Wed, 07 March 2012 18:09 |
Dan Darnell Messages: 145 Registered: November 2011 Location: Arkansas |
Senior Member |
|
|
This is me defining things in the wrong packages again. Doh!
Sorry. I'm still working on switching gears from RBD to EDT when working with this new stuff.
In RBD I am used to creating all of my own packages and therefore the way they are configured to generate is clear in my head.
If I define my records in the "common" package (JS and Java generation ... but technically, for this example, I really don't even need the Java generation and the "client" package would work too) everything is fine.
--Dan
p.s. Shall I argue again for code annotations that set generation targets so that it is clear from the source code itself what sort of generation is going to take place?
[Updated on: Wed, 07 March 2012 18:15] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03688 seconds