Disclaimer

All of the topics discussed here in this blog comes from my real life encounters. They serve as references for future research. All of the data, contents and information presented in my entries have been altered and edited to protect the confidentiality and privacy of the clients.

Saturday, July 6, 2013

Calling Javascript function from OBIEE dashboard

Hello again

This time I am going to show how to call javascript function from OBIEE dashboard. The script can be written and saved in the common.js file located in:

OBIEE_Folder/user_projects/domains/bifoundation_domain/servers/bi_server1/tmp/_WL_user/analytics_11.1.1/7dezjl/war/res/b_mozilla/common.js

I have written a simple script as the follow and I saved it in the bottom of the common.js file:

// MY Stuff
function obi_popup()
{
alert("Hello World")
}

So as you can see, the function name is called 'obi_popup' and the function itself is supposed to return a text 'Hello World' when called.

Once this is done, restart the OBIEE opmn service.

Go to the dashboard and add a text section. In there add the following text:



check "contain HTML markup" box

This will appear a button labelled 'hi there!', and by clicking on it, the javascript 'obi_popup' should be called


Click and the result:



Thanks,

until next time

1 comments:

Unknown said...

Is there a way to add javascript to common.js so that the function automatically runs on a dashboard load? For example, if you wanted that popup to automatically run without adding a text element to every dashboard, could you change it to a window.onload event?

Related Posts Plugin for WordPress, Blogger...