AjaxModalContainer/Dialog with JS resources
AjaxModalContainer/Dialog with JS resources
- Subject: AjaxModalContainer/Dialog with JS resources
- From: Greg Hulands <email@hidden>
- Date: Wed, 08 Apr 2009 21:08:45 -0700
Hi,
Please forgive all these Ajax problems I'm having - this is my first
demo app using the framework and somethings aren't just working. I
have an AjaxModalContainer that is activated with an action binding to
return the contents. The component that is returned has some
ERXJavascript elements in there to load the js files for the
component. The problem I'm seeing is that those resources are not
getting loaded when the content is being set into the div. There is
also a bit of inline javascript in there that relies on the js files
being loaded that executes, but fails because the files haven't being
loaded.
This happens in both safari and firefox so I'm thinking it is
something in the app.
Any ideas?
Thanks,
Greg
This is the component:
<wo:ERXJavaScript filename="js/bespin/dojo/dojo.js" framework="app"/>
<wo:ERXJavaScript filename="js/bespin/bespin/editor/embed.js"
framework="app"/>
<div id="editor" style="height:600px; width: 800px;">
<wo:str value = "$probe.script"/>
</div>
<div id="changes">
Greg
</div>
<script type="text/javascript">
var _editorComponent;
function pushToHiddenInput() {
document.getElementById("changes").innerHTML =
_editorComponent.getContent();
}
// Loads and configures the objects that the editor needs
_editorComponent = new bespin.editor.Component('editor', {
language: "php",
loadfromdiv: true,
tabmode: true,
set: {
theme: 'white'
}
});
_editorComponent.onchange(pushToHiddenInput);
_editorComponent.theme = bespin.themes.white;
</script>
This is the generated fragment:
<script _componentName = "pulse.app.components.EditInstrument"
type="text/javascript" src="/cgi-bin/WebObjects/Pulse.woa/_wr_/wodata=/
Users/ghulands/wowodc/trunk/Pulse/build/Pulse.woa/Contents/
WebServerResources/js/bespin/dojo/dojo.js"></script>
<script type="text/javascript" src="/cgi-bin/WebObjects/Pulse.woa/_wr_/
wodata=/Users/ghulands/wowodc/trunk/Pulse/build/Pulse.woa/Contents/
WebServerResources/js/bespin/bespin/editor/embed.js"></script>
<div id="editor" style="height:600px; width: 800px;">
</div>
<div id="changes">
Greg
</div>
<script type="text/javascript">
var _editorComponent;
function pushToHiddenInput() {
document.getElementById("changes").innerHTML =
_editorComponent.getContent();
}
// Loads and configures the objects that the editor needs
_editorComponent = new bespin.editor.Component('editor', {
language: "php",
loadfromdiv: true,
tabmode: true,
set: {
theme: 'white'
}
});
_editorComponent.onchange(pushToHiddenInput);
_editorComponent.theme = bespin.themes.white;
</script>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden