When using
setPageContentPosition() in a dialog box or frame, you will need to specify an offset left and top page position or ToolBook will always attempt to auto center using ToolBook's internal function. While this is fine for the main window page, it doesn't play well with dialog windows. So specifying
left = 0 and top = 0 will anchor the page to the top left corner of the dialog window or container object and it will disable ToolBook's auto-centering script. The best place to run this function is in the
<config> section of the XML file that loads with the page that will be displayed in the dialog windows or container.
<config>
<setPageContentPosition>
{ left : 0, top : 0, width : [myWidth], height : [myHeight] }
</setPageContentPosition>
</confi>
You can also execute this function on page load in the Actions Editor. If your width and height values are calculated based on other factors, then you may have no choice but to execute
setPageContentPosition() elsewhere in your XML file. The next best place may be in an
<exeJavascriptDirect> tag of the
<config> section, or in an onload function defined in the
<page> section.