[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.birt] Named bookmarks prefixed with report namespace id

In order to resolve a problem I had with clashing css class names when displaying more than one report per page (see link below), I made a call to set a unique namespace id (see below).

HTMLRenderOption options = new HTMLRenderOption();
options.setHTMLIDNamespace( StringUtils.generateRandomString() );

http://www.eclipse.org/newsportal/article.php?id=30842&group=eclipse.birt#30842

I now have a problem that named bookmarks in the report are also prefixed with the namespace which means any javascript code I have referencing these elements no longer work.

To elaborate I have a text item in my report with the following bit of javascript:

<form>
<script>
function toggleIssueDescription()
{

	var issueDescriptionRow = "ISSUEDESCRIPTION";
	var issueDescriptionText = "ISSUEDESCRIPTIONTEXT";

	var hide = false;
	var btnstr = "issueDescriptionButton";


if( document.getElementById(issueDescriptionRow).style.display == 'block' || document.getElementById(issueDescriptionRow).style.display == "")
{
document.getElementById(issueDescriptionRow).style.display = 'none';
document.getElementById(issueDescriptionText).style.display = 'none';
document.getElementById(btnstr).src="<VALUE-OF>params["imageUrl"]+"/plus_icon.gif"</VALUE-OF>";
document.getElementById(btnstr).title="open";
//form.btnstr.value = "+";
hide = true;
} else
{
document.getElementById(issueDescriptionRow).style.display = '';
document.getElementById(issueDescriptionText).style.display = '';
document.getElementById(btnstr).src= "<VALUE-OF>params["imageUrl"]+"/minus_icon.gif"</VALUE-OF>";
document.getElementById(btnstr).title="close";
//form.btnstr.value = "-";
hide = false;
}
}



</script>


The problem is document.getElementById(issueDescriptionRow) is now undefined as the bookmark has the namespace prefix.


Is it possible to figure out the namespace prefix from within a report so that I can change document.getElementById(issueDescriptionRow) to:

document.getElementById("namespaceid"+issueDescriptionRow)

????