cancel
Showing results for 
Search instead for 
Did you mean: 

Passing parameter to QueryTemplate of i5Chart

shaji_chandran
Participant
0 Kudos

Hi Friends,

I would like to pass a parameter value to the QueryTemplate of my i5Chart object. I am using the below code for this. Please let me know if I am doing the right way. I am facing a javascript error while loading the page.

I am on MII version 14.0 SP4 Patch

Java script error

Message: oDomRef must not be null

Line: 141

Char: 19642

Code: 0

URI: http://hostname:50000/sapui5/resources/sap-ui-core.js

Here is the code snippet

<SCRIPT>

var addProps = '{"QueryTemplate":"PI_Report_Builder/Xacute_PcoData_Qry","DisplayTemplate":"PI_Report_Builder/PI_Report_Chart","Applet":"i5Chart","Height":"600","Width":"800","Content-Type":"image/png"}';
var c = new com.sap.xmii.chart.hchart.i5Chart('PI_Report_Builder/PI_Report_Chart','PI_Report_Builder/Xacute_PcoData_Qry',addProps);
c.getQueryObject().setParameter("Param.1","BA:PHASE.1");
c.refresh();
c.draw('content');


</SCRIPT>

Thanks

Shaji Chandran

Accepted Solutions (1)

Accepted Solutions (1)

Private_Member_14935
Active Participant
0 Kudos

Hi Shaji,

The order of the js code is an issue, you are supposed to call refresh() only after draw() has been called.

i.e., the below should work fine:

<SCRIPT>

var addProps = '{"QueryTemplate":"PI_Report_Builder/Xacute_PcoData_Qry","DisplayTemplate":"PI_Report_Builder/PI_Report_Chart","Applet":"i5Chart","Height":"600","Width":"800","Content-Type":"image/png"}';
var c = new com.sap.xmii.chart.hchart.i5Chart('PI_Report_Builder/PI_Report_Chart','PI_Report_Builder/Xacute_PcoData_Qry',addProps);
c.getQueryObject().setParameter("Param.1","BA:PHASE.1");

c.draw('content');

c.refresh(); //refresh() should be called only after draw()


</SCRIPT>

The way you are trying to pass parameter to the query template object also looks fine.

Also, is there any specific reason for the order that you have for the js code.

Please try and let me know.

Thanks and Best Regards,

Ria

shaji_chandran
Participant
0 Kudos

Thanks Ria.

When I called refresh() after draw() it worked fine.

thanks a lot

Answers (1)

Answers (1)

0 Kudos

Which version of the UI5 library do you have deployed on your MII instance.  This is visible in the NetWeaver System Information -> Components Info

Then filter the Name column with UI5

Sam