cancel
Showing results for 
Search instead for 
Did you mean: 

setDisplayTemplate() returns java.lang.NullPointerException

Former Member
0 Kudos

Hi Experts,

I am getting a javascript error (java.lang.NullPointerException) when trying to update the display template of a chart at runtime through JavaScript. We are doing this on another applet with no problems. Here is the code (for some reason SCN is now showing the code so I attached as an image):


<object id="TagChart" name="TagChart" codebase="/XMII/Classes" Code="iChart" archive="illum8.zip">

<param name="QueryTemplate" value="Base_Metals/Ontario/TestQuery">

<param name="DisplayTemplate value="Base_Metals/Ontario/TestChart">

</object>


<script type="text/javascript">

alert(document.TagChart.getDisplayTemplate()); //return the string message: Base_Metals/Ontario/TestChart

document.TagChart.setDisplayTemplate("Base_Metals/Ontario/Test2Chart"); //returns java.lang.NullPointerException

</script>

Setting the DisplayTemplate to an empty string causes no errors so maybe it has something to do with the forward slashes (/) ?

Appreciate any help on the matter.

Thank you,

Corey

Vale

MII Version: 14.0 SP6 Patch 9

Message was edited by: Corey Jackson

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I solved the issue. The issue was due to an invalid display template specified to be set.  If the template does not exist JavaScript will throw the exception java.lang.NullPointerException.  If the template exists then no error will occur.

Corey

Answers (0)