PDA

View Full Version : how to update BasicDialog through ansynConnection.



kd21
20 Feb 2007, 1:09 AM
hi to all

i want to know how to update my BasicDialog after the ajax connection...

i m using BasicDialog
when i click the submit then one serverside page invoked and give some response...
every thing is fine ...

only issue is how to put that response in my basicDialog...or how to update...

am i right way or not plz help me
my code is.............


submitDialog : function() {
mail = getEl("forget_email").dom.value;

div = document.getElementById("forDiv");
postdata="forget_email="+mail+"&button=send_mail";

success: function(o) {
if(o.responseText !== undefined){
div.innerHTML = o.responseText;
}
};
failure: function(o) {
if(o.responseText !== undefined){
div.innerHTML = o.responseText;
}
};
var request=YAHOO.util.Connect.asyncRequest("POST", "AuthServlet", {success:this.success, failure:this.failure}, postdata);
},

showDialog : function(){
if(!dialog){ // lazy initialize the dialog and only create it once
dialog = new YAHOO.ext.BasicDialog("forget-dlg", {
//modal:true,
autoTabs:true,
width:400,
height:200,
shadow:true,
minWidth:300,
minHeight:250,
proxyDrag: true
});
dialog.addKeyListener(27, dialog.hide, dialog);
dialog.addButton('Close', dialog.hide, dialog);
dialog.addButton('Submit', Layout.submitDialog, Layout);
}
dialog.show(dialogEl.dom);
}
};
}();
YAHOO.ext.EventManager.onDocumentReady(Layout.init, Layout, true);

Animal
20 Feb 2007, 1:50 AM
dialog.body.getUpdateManager().formUpdate(...


See docs.

kd21
20 Feb 2007, 3:48 AM
thanks

but where i see this ....
plz give some more information...

kd21
20 Feb 2007, 4:43 AM
hi animal

My response is coming as text
and i want to add this Text with Basic dialog. Through innerHTML like

success: function(o) {
if(o.responseText !== undefined){
div.innerHTML = o.responseText;
}
};

kd21
20 Feb 2007, 4:55 AM
hi Animal

I think i give again full description.. what i want to do

I am taking a email id through basicDialog, where is only one input text box

and i am adding two button Like

dialog.addButton('Close', dialog.hide, dialog);
dialog.addButton('Submit', this.submitDialog, Layout);

here i m using one eventHandler submitDialog

this event handler make a connection through "YAHOO.util.Connect.asyncRequest" and we get the only text as response through servlet

now i want put this text in BasicDialog through innerHTML
my responce are coming i saw in fireBug but not updated Basicdialog

what can i do.........