Try
top.$('placeholder').replace( response.responseText);

This is ugly !!
If everything has to be done in your backgroung page, do a function accessible in it and change onSucces to onSuccess:top.myFunction

Not tested but it should work
Seb

On Apr 4, 2007, at 1:45 PM, Feliu Quetglas wrote:

Thanks again Sébastien,

You was really clear. I test it and it works, if the "placeholder" div is in the "prototype window" i have, but my placeholder div is in the background page so, ajax runs correctly but not update the div. Do you understand me?

Thats my new code:

function asignarPaciente(){
var url = '../include/busqueda_conditions.php';
var pars = Form.serialize('nuevo_paciente');

 var myAjax = new Ajax.Request(
            url,
            {
                method: 'post',
                parameters: pars,
                evalScripts: true,
                onFailure: reportError,
                onSuccess: myFunction,
             });
}

function myFunction(response) {
    parent.Windows.getFocusedWindow().close();
    $('placeholder').replace( response.responseText);
    return true;
}

Many Thanks for your help mate!

On 04/04/07, Sébastien Gruhier <[EMAIL PROTECTED]> wrote:
I was meaning onSuccess callback (look at callback lists here http://prototypejs.org/api/ajax/options) In your case, I think you should use Ajax.Request instead of Ajax.Updater and do what you want in onSuccess callback.
Something like

    var myAjax = new Ajax.Request(
            url,
            {
                method: 'post',
                parameters: pars,
                evalScripts: true,
                onFailure: reportError,
                onSucess: youFunction,
            });}

function yourFunction(response) {
        $(' placeholder').replace(response.responseText);
        // And add your specific code here
}

Clear enough?

On Apr 4, 2007, at 9:19 AM, Feliu Quetglas wrote:

Hi Sebastien,

Thx for your answer, i know what are you talking about. I'm using success: "'placeholder'" thats means send the content of ajax response to div id "placeholder", the problem is this div are in body (on the background), and i need button that closes the window and later send form info to this div.

Is that posible?

Thanks at all!





On 04/04/07, Sébastien Gruhier <[EMAIL PROTECTED] > wrote:
You should use onSuccess: callback on your ajax call to do whatever you need to do when you Ajax request is done.
Seb

On Apr 2, 2007, at 11:15 AM, Feliu Quetglas wrote:

Hi all!!

First i want to thanks your speedy help on my last problem. Now I have another question. I have one window with nice wizard, i create it by the following code:

function openAjaxPopup(link,title,width,height) {
        var win = new Window({
          id:                "pacientes",
          className:         "alphacube",
          showProgress:         true,
          parent:            document.body,
          title:             title,
          url:               link,
          width:             width,
          height:            height,
          resizable:         false,
          closable:          true,
          minimizable:       false,
          maximizable:       false,
          draggable:         false,
          userData:          null,
showEffect: (Window.hasEffectLib ? Effect.Appear : Element.show), hideEffect: (Window.hasEffectLib ? Effect.Fade : Element.hide),
          showEffectOptions: {},
          hideEffectOptions: {},
          effectOptions:     null,
          parent:             $('placeholder'),
          onload:            Prototype.emptyFunction,
          opacity:           1,
          recenterAuto:      true,
          wiredDrag:         false,
          closeCallback:     null,
          destroyOnClose:    false,
          gridX:             1,
          gridY:             1,
            })
        win.showCenter(true);

      }

When the wizard finishes i create a button that calls this funcion:

          function closeAjaxPopup() {
                parent.Windows.getFocusedWindow().close()
              return true;
          }

My problem is that i need to call some AJAX function (coded below), that sends some info to div in document BODY, and i dont know how to refer it, here is the ajax funtcion i need to call:

function asignarPaciente(){
var url = '../include/busqueda_conditions.php';
var pars = Form.serialize('nuevo_paciente');
    var myAjax = new Ajax.Updater(
            {success: 'placeholder'},
            url,
            {
                method: 'post',
                parameters: pars,
                evalScripts: true,
                onFailure: reportError
            });}

The form serialize is the form appears in prototype window, my idea is make a button that calls first asignarPaciente() function and later closeAjaxPopup(), then the window will be closed and the DOCUMENT BODY, DIV will be refreshed.


Hope you can help me,
Thanks a lot!!


--
Feliu Quetglas Canals
Balear de Chequeos S.L.
Telf.: 971 76 75 75 - Mov.: 669 25 27 43
email: [EMAIL PROTECTED]
_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com



_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com




--
Feliu Quetglas Canals
Balear de Chequeos S.L.
Telf.: 971 76 75 75 - Mov.: 669 25 27 43
email: [EMAIL PROTECTED]
_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com


_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com




--
Feliu Quetglas Canals
Balear de Chequeos S.L.
Telf.: 971 76 75 75 - Mov.: 669 25 27 43
email: [EMAIL PROTECTED]
_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com

_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com

Reply via email to