Forum: Ruby on Rails closing popup

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5800360843e7e19082bc692fac18db2c?d=identicon&s=25 Claudio Claudio (netbomb)
on 2007-02-02 09:49
Hi,
i'm using popup in my application when i have to use a form to submit
some data:

link_to "Add", {:action => "add_customer"}, :popup => ['new',
'height=300,width=300']

When i push submit i like that the popup closes and refresh the main
page that show the list of data.

thanks

claudio
A2c85dc5ee81b12e3cc0a6522e8d079d?d=identicon&s=25 Chris Hall (au5lander)
on 2007-02-02 16:41
(Received via mailing list)
this is really a javascript question.  off the cuff, what i would do
is submit the form.  if the form data was successfully processed, use
some javascript to redirect the parent window to the location you want
then close the child window.  if it failed, just redisplay the form in
the child window.

I'll leave the implementation up to you.
5800360843e7e19082bc692fac18db2c?d=identicon&s=25 Claudio Claudio (netbomb)
on 2007-02-02 16:49
thanks
claudio
Ffb15a8418eb7f49060b6764aba1dc52?d=identicon&s=25 Rm Rm (rmehta)
on 2007-02-14 06:27
hi,

I have to implement a similar functionality, how did you do it finally?


Claudio Claudio wrote:
> thanks
> claudio
408ef3d328434279d828e7aa2d92b7a8?d=identicon&s=25 Neha Chopra (neha_rohan)
on 2008-02-01 17:45
Can someone help me also to work out this scenario...
from a main window, i open  a popup, then submit the popup, do some
server side call, after this i close the popup window and now i need to
update a DOM in my main window.
How can i acheive this or should i be looking for any other way.

Thanks in advance
Neha
Aad37b5f7116c8d1f547d23b37566032?d=identicon&s=25 Greg Donald (destiney)
on 2008-02-02 00:03
(Received via mailing list)
On 2/1/08, Neha Chopra <rails-mailing-list@andreas-s.net> wrote:
>
> Can someone help me also to work out this scenario...
> from a main window, i open  a popup, then submit the popup, do some
> server side call, after this i close the popup window and now i need to
> update a DOM in my main window.
> How can i acheive this or should i be looking for any other way.

window.opener.location.reload();


--
Greg Donald
http://destiney.com/
408ef3d328434279d828e7aa2d92b7a8?d=identicon&s=25 Neha Chopra (neha_rohan)
on 2008-02-02 00:18
Greg Donald wrote:
> On 2/1/08, Neha Chopra <rails-mailing-list@andreas-s.net> wrote:
>>
>> Can someone help me also to work out this scenario...
>> from a main window, i open  a popup, then submit the popup, do some
>> server side call, after this i close the popup window and now i need to
>> update a DOM in my main window.
>> How can i acheive this or should i be looking for any other way.
>
> window.opener.location.reload();
>
>
> --
> Greg Donald
> http://destiney.com/

The problem is i cant reload the whole of the main window, i just have
to update a div.
This topic is locked and can not be replied to.