Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Plain JS object from literal
Plain JS object from literal [message #1264745] Wed, 05 March 2014 13:18 Go to next message
Max Pavlov is currently offline Max PavlovFriend
Messages: 3
Registered: March 2014
Junior Member
Why i can't create JS object from literal and add properties to it;

Try in scripted data set on open:

var o = {};
o["p"] = 123;

Have exception: Java class "java.lang.Object" has no public instance field or method named "p";

BIRT version 4.3.1
Re: Plain JS object from literal [message #1264937 is a reply to message #1264745] Wed, 05 March 2014 16:22 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
This script works for me, with Eclipse 4.3.1.

May be the exception is due to the fact you rely this object "o" would be available in methods "fetch" or onFetch" of your scripted dataset, but you scoped it with "var" so it is local to the method. You should try to remove "var"
Re: Plain JS object from literal [message #1265539 is a reply to message #1264937] Thu, 06 March 2014 08:22 Go to previous messageGo to next message
Max Pavlov is currently offline Max PavlovFriend
Messages: 3
Registered: March 2014
Junior Member
It work in beforeOpen handler of Script Data Set
But not work in open handler of Script Data Set

Who can explain it?

Found!

Stops working after:

importPackage(Packages.java.lang);

[Updated on: Thu, 06 March 2014 09:32]

Report message to a moderator

Re: Plain JS object from literal [message #1265586 is a reply to message #1265539] Thu, 06 March 2014 09:30 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
As i said it works for me, even in the open handler of a scripted dataset or anywhere else. See report attached.

You should post a sample report highlighting the issue.
  • Attachment: scripted.zip
    (Size: 1.39KB, Downloaded 128 times)
Re: Plain JS object from literal [message #1265587 is a reply to message #1265586] Thu, 06 March 2014 09:33 Go to previous message
Max Pavlov is currently offline Max PavlovFriend
Messages: 3
Registered: March 2014
Junior Member
Problem founded

Stops working after:

importPackage(Packages.java.lang);
Previous Topic:Exception while trying to view report definition
Next Topic:Java HEAP Errors in Birt Viewer Runtime on Tomcat
Goto Forum:
  


Current Time: Thu Apr 25 23:30:27 GMT 2024

Powered by FUDForum. Page generated in 0.02432 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top