Hi Jacob,
Jacob Wills wrote:
The problem is, any controls on the page that use javascript (like
Click-Calendar's CalendarField) don't work, since the external .JS files
aren't being passed in along with everything else. The CSS transfers
just fine, but $jsImports is always empty and when I tried to make use
of getHtmlImports() I found that it isn't even being called during the
process.
So $cssImports is populated but $jsImports is not? This is strange
because both variables are set and processed at the same time.
Even if I try to hack around things and include the .JS files
in the container's page, the controls within the AJAX'ed page still
won't work.
Some Click controls such as CalendarField makes use of the
addLoadEvent function in the script, control.js. addLoadEvent is fired
when the page DOM is ready which is similar to JQuery's "ready"
function. In other words a component such as CalendarField can
register itself to receive a callback when the DOM is ready. What
might be happening here is that the Ajax call is made after the page
DOM is ready, thus when CalendarField registers itself with
addLoadEvent it never receives the callback because the DOM ready
event is not fired again.
As a workaround you can try to add the following JavaScript script
snippet in your container Page:
if (typeof(Click) != 'undefined')");
script.append("if (typeof(Click.domready) != 'undefined')");
script.append("Click.domready.ready = true;
The above snippet will programmatically set the "ready" variable to
true so when CalendarField registers itself with addLoadEvent its
callback should occur immediately.
Let us know if this works or not.
kind regards
bob