Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
JSAPI - How to alter string in a Text Element.
millvall
Hi Folks,
Inside an HTML Btn I have code below to access a Text element on the page. It uses JSAPI to successfully get a handle to the element and contents. But, I can *not* find a setText() or a way to alter the text.
-- OR -- Can I get hold of "document" so I can do the usual:
document.getElementById("IDNAME").value="New Stuff";
Any tips welcome.
Thanks
Milt.
--- WORKING CODE --
var v = this.getViewer();
var pgc = v.getCurrentPageContent();
var tp = pgc.getTableByBookmark("OFFICETABLE_BK");
var oc = pgc.getTextByBookmark('A1'); // A1 is bookmark of a Text Element
octext = oc.getText();
alert("octext = " + octext); // Displays current contents good!!
// So how to alter it?
// I need: oc.setText("New Stuff"); or another way to alter text.
-- EOM ----
Find more posts tagged with
Comments
Virgil Dodson
Hi millvall,<br />
<br />
There is more information about the JSAPI here:<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/wiki/GSG:Getting_Started_with_BIRT_JavaScript_API/'>GSG:Getting
Started with BIRT JavaScript API - BIRT Wiki - BIRT Exchange</a><br />
<br />
but I havent seen anything in the doc about using the JSAPI to change data on the report.<br />
<br />
One that you might experiement with is the Bookmark tag in the BIRT Designer. If you bookmark something in BIRT, it becomes an element that you can use getElementById to access.