Skip to Content
author's profile photo Former Member
Former Member

Custom Javascript not being called in WAD 7.0 Template

Hello 2 all,

i have a weird problem concerning a custom-written javascript in a WAD 7.0 Web Template.

I created a script item (over the tool bar in the layout tab) in the template and added a custom javascript function to it, which task is to iterate over all rows + columns of an analysis item (formerly table item in 3.5) and perform some manipulation in certain table cells.

My problem now is, that this javascript is not called at all, when the template is executed in the browser.

I tried to initiate the invocation of this function at the page bottom manually by adding:

<script type="text" language="javascript">





but this had no effect at all. I also tried to add an html script tag over the context menu in the layout tab calling the javascript with an ondatasetcomplete event handler, but this also did not work.

The same javascript works perfectly fine in a 3.5 template (i copied + pasted the code), but not in 7.0. The function is not even invoked at all (i have an alert() in the function head to make sure the code is hit).

Does anybody have an idea, how i can make sure, that my javascript is executed at all?

It's no option to call it already in <body onload="">-Handler, since the table item to be manipulated is not yet filled with data at that time. The script must be executed AFTER all BI Web Items have been initialized. In 3.5. this was simply possible by adding the function call at the bottom of the template (see snippet above), but obviously not in 7.0.

Did anybody face this problem too? What can i do to make my code running? Any help will be rewarded!

Thanks in advance & chers,


Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 09:24 PM

    Add the code before closing the body tag.

    Also first test it with a simple JS alert.

    <script type="text" language="javascript">
    alert("before body");

    This works fine for me, adding to the onload event does not work, this is a known limitation in the new front end.

    You can also look at the generated HTML source whether your code is send to the front end.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hey Tobias and Deepu,

      thanks for your ideas. I finally made my javascript run in WAD 7.0 template, though i made the experience that the invocation of my javascript function (which i included, as Tobias suggested, within a script item) only works,

      when the function call in the xhtml tab is enclosed within a

      <script type="text/javascript"></script>

      tag. No, i am not a complete newbie to javascript as one might guess 😊, but from former 3.5 WAD i was used, that the script tag could also have the following syntaxes:

      <script type="text" language="javascript"> or even <script></script> worked.

      But in 7.0 it appears to me, that <u>only</u> the first-mentioned syntax works.....

      anyway, thanks for your help.

      But now i face another problem: how am i able to access the html DOM object tree within my javascript? i need to manipulate the layout and content of an analysis item (table item in 3.5), but when i try to access the table by name and/or id, i always obtain an undefined value....

      any ideas?



  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2007 at 07:09 PM

    Did you ever get a resolution? I'm trying to do a similar thing.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Simple workaround...

      1. Create a function that calls your custom it whatever "fnStartup()"

      2. Set your page.onload equal to "fnStartup" at the top of the BI 7.0 JavaScript window.

      NOTE: Do NOT call your function in your HTML with surrounding script tags or from the body "onload."

      Hope that answers your question


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.