I've read the WebControlSDK over a dozen times, and I'm still struggling to know what goes where to get things to work.
1)
From looking at the examples it appears I should put the Load Libraries event in the Open() event.
For LoadLibraries() I must also set a callback function.
But according to the documentation the order of events goes:
Open()
SetupHTML()
SetupCSS()
SetupJavaScriptFramework()
So it would be executing the callback before the HTML or even the javascript with the callback event exists.
Am I missing something here?
==========
2)
I have another question about the order of things.
I'm trying to make a Graph from some sample HTML of a Google Chart.
The HEADER has the
<script> tags
but BODY has the actual element.
Does the HTML get loaded before the header? In my head, I would have guessed that the Header would run before the Body, but since the header scripts are interacting with parts of the body, the body must exist first right?
==========
3)
I have a function:
RSCustom.<<Namespace>>.<<ControlId>>_constructor = function() {...}
But do I need to call the constructor, or is this something the wrapper class does automatically?
Should this be set as the callback? To me this doesn't make sense because I specify the callback event before this function even exists from the SetupJavascriptFramework() method.
In the constructor method I load some google libraries and call:
google.setOnLoadCallback(RSCustom.<<Namespace>>.<<ControlId>>_drawChart);
Does it matter that google is doing it's on OnLoadCallback?