normunds
2008-Feb-05 11:16 UTC
I wonder what limitations exist when using prototype to manipulate elements in a dialogue window
For example I open a window, write some html: var win = window.open("", "dlg", "width=500,height=500"); var doc = win.document; with (doc) { write("<html>"); write("<body><p id=''start''></p></body>"); write("</html>"); close(); } And then I want to insert some objects from the current document. For all I can tell, the elements in popup cannot get extended (I''m using prototype 1.6.0.2). Neither automatically (as a return value), not explicitly: var p = Element.extend(doc.getElementById("start")); // this does not extend the element, right? Element.insert(p, $(''message'')); // works; "message" is an element in the current doc p.insert ($(''message'')); // does not work Is there a workaround - a way to extend the elements from the pop-up? Referencing of the prototype.js also in the pop-up window does not seem to make any difference. Are there any other things that does not work when working with several windows? Thanks, Normunds --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Gareth Evans
2008-Feb-05 11:18 UTC
Re: I wonder what limitations exist when using prototype to manipulate elements in a dialogue window
Hi Normunds I posted about this in another thread just a second ago regarding setStyle not working on an iframe. Search my file browser thread a few months back. I ran into a similar problem and never found a workaround and used a lightbox instead. Perhaps the core guys could shed some light? Gareth On Feb 6, 2008 12:16 AM, normunds <nkalnberzins-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> > For example I open a window, write some html: > var win = window.open("", "dlg", "width=500,height=500"); > var doc = win.document; > with (doc) { > write("<html>"); > write("<body><p id=''start''></p></body>"); > write("</html>"); > close(); > } > > And then I want to insert some objects from the current document. For > all I can tell, the elements in popup cannot get extended (I''m using > prototype 1.6.0.2). Neither automatically (as a return value), not > explicitly: > var p = Element.extend(doc.getElementById("start")); // this does > not > extend the element, right? > > Element.insert(p, $(''message'')); // works; "message" is an element > in the current doc > p.insert ($(''message'')); // does not work > > Is there a workaround - a way to extend the elements from the pop-up? > Referencing of the prototype.js also in the pop-up window does not > seem to make any difference. > > Are there any other things that does not work when working with > several windows? > > Thanks, Normunds > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
normunds
2008-Feb-05 12:49 UTC
Re: I wonder what limitations exist when using prototype to manipulate elements in a dialogue window
On Feb 5, 12:18 pm, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Normunds > > I posted about this in another thread just a second ago regarding setStyle > not working on an iframe. > > Search my file browser thread a few months back. I ran into a similar > problem and never found a workaround and used a lightbox instead. > > Perhaps the core guys could shed some light? > > GarethThanks, I saw the other post as soon as I posted this one. But I still fail to find your thread. I found one where you are complaining about elements not being extended, but there is no solution in that one; I suspect it might be related to the same case/issue. I think this might have something to do with the use of $() to extend that in IMO works for only the current document. Though Element.extend() is also not working... dunno. It would be interesting to find out what is going on and to get some solution/workaround, but I think I will also go the easy way and either use a simulated pop-up or put some code in the dialogue window to minimize the interaction. Normunds --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---