PDA

View Full Version : Render form via Callback for Panel



rogrdat
10 Aug 2007, 9:55 PM
All,

I am trying to render a form on a contentpanel in a dialog. The dialog shows up but instead of the form being rendered I can see only the JSON response from the server. Any help is greatly appreciated.

thanks,

// Dialog
if(!dialog) {
.... create dialog
}

// Update Layout
var panel = new Ext.ContentPanel('cp', {title: 'The First Tab', fitToFrame:true, autoScroll:true, scripts:true} );
layout.add('center', panel);
loadViewObject(oid, panel);
layout.endUpdate(); // load the content for hte panel
dlg.show();


// Dynamically load content into the panel
function loadViewObject(oid, panel) {
panel.load({
url: "../../test/ViewObject.jsp",
params: {"oid": oid},
callback: TestType.init,
//scope: yourObject, //(optional scope)
discardUrl: true,
nocache: true,
text: "Loading...",
timeout: 30,
scripts: true
});
//return panel;
}

// Callback
var TestType = function() {
...
return {
init:function() {
... create the form
form.render('cp');
}
}
}