PDA

View Full Version : form inside popup



pclacerda
14 Nov 2007, 1:11 PM
I have an HTML form inside a popup (Ext.LayoutDialog) I need the user submits the form and the response appears inside the popup, however what happens is that when the user submits the form the response replaces the whole page....

Here is the popup code (the form is in popup-page.html):

dialog = new Ext.LayoutDialog("popup-dlg", {
modal:true,
width:626,
height:453,
shadow:true,
minWidth:600,
minHeight:443,
proxyDrag: true,
center: {
autoScroll:true,
tabPosition: 'top',
closeOnTab: true,
alwaysShowTabs: false
}
});

dialog.addKeyListener(27, dialog.hide, dialog);
btnConfirmar = dialog.addButton('Confirmar', dialog.hide, dialog);
dialog.addButton('Cancelar', dialog.hide, dialog);
btnConfirmar.on('click',confirmar);

var layout = dialog.getLayout();
layout.beginUpdate();
conteudo = new Ext.ContentPanel('center', {title: ''});
layout.add('center', conteudo);
conteudo.load({
url: './popup-page.html',
discardUrl: false,
nocache: false,
text: "Carregando...",
timeout: 30,
scripts: false
});


// generate some other tabs
layout.endUpdate();
dialog.show(Ext.getDom());

ferr
14 Nov 2007, 1:18 PM
If I understand what you're saying, your user presses the Confirmar button and the layout dialog becomes hidden.

You seem to be assigning your Confirmar click event to two instructions, one to hide the dialog with dialog.hide and another calling a seemingly undefined function called confirmar. If you do not want to hide the dialog in the event that the Confirmar button is clicked, replace the dialog.hide function call with the confirmar function call, remove the on click event handler, and define the confirmar function.

pclacerda
16 Nov 2007, 9:05 AM
Yes I don't want to hide the dialog, but the point is that if button confirmar submits a form I need the form response be loaded inside the dialog area and not replace the whole page. Does anyone knows how?