Forum: Ruby on Rails RJS and Greybox : executing the js in the parent window?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Alain R. (Guest)
on 2006-04-26 10:45
Hi all,

Can a child window manipulate its parent window with RJS?

In an application a parent/master window shows a list of records. When
the users press  'edit', a greybox windows pops up where they can update
one item attributes.
Problem: after the 'save' and child window closing, the parent window
still contains the old attributes values.

I know how to trigger plain javascript execution in the parent, to clean
the parent window f.ex, but RJS is really what I need.

Is that possible?

Alain R. (Guest)
on 2006-04-26 16:32
(Received via mailing list)
> Question:
   > Can a child window manipulate its parent window with RJS?

As a workaround, I have the children execute some javascript code
that in turn has the parent execute some javascript code where I
inserted an Ajax call to a controller action that refreshes the parent

=> when the user submit the action in the child/greybox window, it
calls an action :

   def update
                render :partial =>

file: _hide_greybox_and_refresh_details_in_parent.rhtml:
      <script type="text/javascript">

, and the parent page html starts with:
   <script type="text/javascript">
         function refresh_contact_details(){
                  new Ajax.Request('/gids/display_entity_details/'+<%= %>,
                           {asynchronous:true, evalScripts:true});

My question: is there a way to execute one single RJS call in the
'update' function above, that would do the same as this 3-part action?
Franco S. (Guest)
on 2008-04-04 20:17
Hello Alain

I'm right looking to obtain the same behavior.
In the meantime, did you found a solution with RJS?

This topic is locked and can not be replied to.