Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Question Can I use a Java class instead of Javascript
grather
I have been trying to integrate BIRT into our application.
We are using hibernate. So my datasource is really a Java Object.
So I solved the problem using scripted data sources.
All is well it works but really seems wrong.
I go from Java to javascript to call a java class.
Get the data back through javascript calls.
It just seems clunky.
I just finished the BIRT into class today and the instructor was talking about I could write a Java event handler.
I assume this replaces my open/fetch javascript calls?
But need a bit more help with this.
Can it be done?
What do I really need to do?
Gary Rather
Are there any examples?
Find more posts tagged with
Comments
pauljin
You can definitely use a java to write a event handler.
YOu have to write a POJO extending the required calsses . For instance if you are writing a event handler for chart the code will looks like the one I specified below
public class gaugeHandler extends ChartEventHandlerAdapter {
/*override the event you want to do .here i am over riding beforeGeneration */
public void beforeGeneration(Chart cm, IChartScriptContext icsc) {
//your custom code goes here
}
}
Once you have finished with your POJO you have to go to report designer. Select the object you want to give the event handler. For this instance I will select the chart from the reportdesigner . Once you select the object go to the property editor and choose eventhandler from it as I illustrated in the attached pic.... the next time you run the report java event handler will come into effect
Make sure one thing.
There is order of precedence for event handler.
So if you have java script and java for a event.
java script will get the precedence .....................
grather
I have my book at work.
But I think I just read
I can call my POJO instead of my of open and fetch javascript methods.
I assume the my IntegratingBirt book will have the list of events
I am sure I'll write more later in the day.
Gary