Widget Woes (RESOLVED)

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
soa
Posts: 287
Joined: Mon Dec 07, 2015 3:15 pm

Widget Woes (RESOLVED)

Post by soa » Fri Aug 23, 2019 5:30 pm

I'm trying to implement a widget around FushionCharts - a popular charting js library we've being using for years. I can get it to display something if put all the code in the onRealizeControl but that's not realistic for real world use. I have

PROTOTYPE.onRealizeControl = function( parentDiv )
{
parentDiv.id = "charthere";

this.m_chart = new FusionCharts({type: 'line'});
this.m_chart.height= '100%';
this.m_chart.width='100%';
}

and later

PROTOTYPE.UpdateXML = function()
{
this.chart.setXMLData('some XML');

}

This produces the error

Cannot read property 'setXMLData' of undefined

It can't seem to find this.chart even though it was created at onRealizeControl.

I'm a bit in the dark, any suggestions would be great.

Cheers
Jim

dannyoorburg
Posts: 152
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

Re: Widget Woes

Post by dannyoorburg » Fri Aug 23, 2019 6:29 pm

You just needed a second pair of eyes 😉

this.m_chart instead of this.chart

Cheers,
Danny

soa
Posts: 287
Joined: Mon Dec 07, 2015 3:15 pm

Re: Widget Woes

Post by soa » Fri Aug 23, 2019 7:16 pm

Doh!

Thanks Danny. When you're dealing with stuff your half understand you expect difficult problems not dumb ones!

Have a great weekend

Post Reply