PDA

View Full Version : BasicDialog: modal overlay doesn't close



q_no
18 Apr 2007, 7:34 AM
Hello!

I've got a basicdialog with a (login-)form inside. When the user hits the submitbutton (created by the form) I check with xajax in the background if the entered data is correct or not.

When everything is fine, I call loginDialog.hide(); via xajax - the dialog itself closes but the overlay div in the background keeps open. What can I do?

Here's my source... it's very...call it "experimental" :)




var loginDialog;
return {
init : function() {
},
login: function() {

if (!loginDialog) {
var loginDialog = new Ext.BasicDialog("ccdsLoginDialog", {
height: 200,
width: 300,
modal: true,
proxyDrag: true,
shadow: true,
resizable:false,
closable:false

});
var loginForm = new Ext.form.Form("ccdsLoginForm",{
labelWidth: 80
});

loginForm.add(
new Ext.form.TextField({
fieldLabel: 'Benutzername',
name: 'loginname',
width:175,
allowBlank:false
}),

new Ext.form.TextField({
fieldLabel: 'Passwort',
name: 'loginpass',
width:175
})
);

loginForm.addButton('Login', function(){
xajax_initApp({});
});
loginDialog.addButton('Cancel', loginDialog.hide, loginDialog);
loginForm.render('ccdsDIVLoginForm');
loginDialog.show(Ext.get('container'));

}
},
loginClose: function () {
loginDialog.hide();
}

};
}();


Ext.EventManager.onDocumentReady(ccdsUI.init, ccdsUI, true);


Maybe your are wondering what xajax is - it is an ajax framework based on PHP which offers alot of functions and I'm used to it, that's why I don't use the yui-ext ajax functions.

From serverside I tried different ways:

loginDialog.hide(); (overlay keeps open)
ccdsUI.loginClose(); (overlay keeps open)

When I put loginDialog.hide() into my onclick function on the button it works



loginForm.addButton('Login', function(){

loginDialog.hide();
xajax_initApp({});
//alert(xajax.getFormValues('ccdsLoginForm'));
});


But the point is, that I don't want to close the window immediately when the user hits the button - I need to check the data first and close it afterwards.

any ideas?

q_no
18 Apr 2007, 8:02 AM
..solved...


I've defined var loginDialog twice... :(


delete this thread please :)

tryanDLS
18 Apr 2007, 8:04 AM
Is your dialog rendered to document.body?