Sébastien Gruhier wrote:
Hi
I had a look to your code. few things
First I tink you should add a "var" before your "win = new Window(winid, options);" Then about /window.frames[winname].do_save is not a function /that's weird but I have to say that I had an hard time to understand your code. You are going back and forth from the parent window and the frame.

What I suggest is to use an observer for the close button, it will be cleaner. About the URL, do you really need an url? URL is fine if your open something that is not in your server, else I will suggest to use ajax. Personnaly, I do not like iframes.

HTH
Seb

Thanks for your reply. Your suggestions are good, but did not affect the problem.

I did eventually figure out what is going on. It turns out that the /window.frames[winname]//.do_save/ form is not supported in Firefox. I don't know why it works once, but in general it does not work in Firefox. Fortunately, the form that does work is /window.frames[n]//.do_save()/ where n is the index where /window.frames[n].name == winname/.

So /window.frames[n]//.do_save()/ does not work, but
/        var inx = -1;
       for (var i=0; i < //window.frames//.length; i++) {
         if(winname == //window.frames//[i].name) {
           inx = i;
          }
       }
       if ( inx >= 0 ) {
         window.frames[inx].do_save();
       }/
does work.

This can be greatly simplified with Prototype to this:
/        $A(window.frames).find( function(f) {
               return (f.name == winname);
           }).do_save();
/which does work on Firefox, IE and Opera.

I absolutely agree with you about not using URL windows if possible. The reason I am using a URL window in this case is that I am trying to use a wysiwyg editor to allow my users to edit some content. Of the three open source editors I've found, none of them play well with others. They all make assumptions about the environment that make them hard or impossible to integrate into my prototype/scriptaculous/windows pages. So I launch the editor in a nice clean environment of its very own and present it on the page with a URL window. For most of the rest of my work, I load stuff into a div window as you suggest.

As for the convoluted code, some of that is a result of trying to control the embedded application across the iframe barrier. That is just messy at the best of times. But some of it is a result of deficiencies in the 'close' logic of windows.js. I want to talk to you about these, but since it is such a big topic, I will do so in another thread.

Thanks for your great work and your continued willingness to help us.

-- Will Merrell


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

Reply via email to