PDA

View Full Version : Load External page into iframe and form submission



vayumahesh
14 Aug 2008, 11:05 AM
I have a layout panel. Inside, I have Tree Panel (with multiple Classes and Assignments as Nodes) on left side and Tab Panel (with 2 tabs, one for Class and another for Assignment) at the center.

When I click on any Class node in the tree, I am activating Class tab and loading an external JSP page1 with form submission (POST method) into the tab. At the same note,
When I click on any Assignment node in the tree, I am activating Assignment tab and loading an external JSP page2 with form submission (POST method) into the tab.

Here is my code

Tree Listener that tells to load the page into tab panel.


updTrTree.addListener('click', function (node, event){
if(node.attributes.trClass == 1)
updateTab('selfMon_tab',node.attributes.id,'extJs/desktop/selfMonitoring.jsp');
else if (node.attributes.trClass == 0)
updateTab('submitForMgrApp_tab',node.attributes.id,'extJs/desktop/engrToMgr4App.jsp');
//Ext.getCmp('selfMon_tab').body.update('test1');
});


Method that is invoked and loads the page into tab panel


function updateTab(tabId,caId,url) {
var tab = UpdTrTabPanel.getItem(tabId);
UpdTrTabPanel.setActiveTab(tab);
tab.load({
url: url,
params: {couAssiId: caId}, // or a URL encoded string
discardUrl: false,
nocache: true,
text: "Loading...",
timeout: 10,
scripts: true // Use this config-option else it won't work!
});
tab.show();
}


Tab Panel Definition


var UpdTrTabPanel = new Ext.TabPanel({
region:'center',
activeTab: 0,
items: [{
title: 'Self-Monitoring',
html: ' Self Monitoring Form for Course',
id: 'selfMon_tab'
},{
title: 'Manager Approval Form',
html: ' Submit for Manager Approval Form for Assignment',
id: 'submitForMgrApp_tab'
}]
});


Everything works OK except I need to load the external pages inside an iframe so that I stay within the layout panel even after form submissions.

How to have an iframe inside the tab panel and load an external page into the iframe that does form submission ? Please help.

Thanks
vmrao

18 Aug 2008, 8:22 AM
look at the extensions forum, doug hendric's managed iframe component specifically.