Closed (fixed)
Project:
Automodal
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2010 at 17:52 UTC
Updated:
1 Apr 2011 at 14:56 UTC
Great module, I have one question.
If I load a form with automodal, how can I refresh the page after the form submit? This wouldn't be the case for all pages loaded with automodal, but maybe for some..
Thanks
Comments
Comment #1
rc2020 commentedYes, I am also interested in this.
Comment #2
kristen polI need this too. I wasn't able to get refresh to work with the popups module so was hoping it would work with automodal.
Kristen
Comment #3
lelizondo commented@kepol actually with popups it's really easy, all you have to do is change the link class to something like popups-form-reload (it's in the README)
Comment #4
rc2020 commented@lelizondob, that is a good suggestion and I thank you for it, but automodal is infinitely superior to popups module because of the formsapi support...is there a way to perform the auto-reload with automodal?
Thanks!
Comment #5
lelizondo commentedNot that I know. There's plenty of examples but I haven't had the time to analyze them and Javascript is not 'my thing'. I don't know if the owner of this module could give us a hand with this.
Comment #6
mauro72 commentedI found a way to reload the page using automodal, is not 100% because you have to add some code into the the automodal.js file.
Anyway, the idea is to uncommnet the onSubmit parameter in the automodal.js file and create the functions that controls what to do when the form is submitted.
The args.reload value is passed trough a custom form_submit function that we have to create in a custom module, in my case the form id is ct_tickets_node_form,
I added the ?modal=close, to the href attribute of the link that triggers the automodal event
where the function modalframe_tickets_form_submit is
with this when you save the node form, the modal window is closed and the page is reloaded. One thing to solve is to achieve this behavior without hacking the automodal.js file.
Comment #7
Aldus commenteddid someone come out with a less invasive solution?
Comment #8
marcel66 commentedI'm not very sure but try to change in modalframe_example.js :
function onSubmitCallbackExample(args, statusMessages) {
...
location.reload();
}
Comment #9
iTiZZiMO commentedthx for the solution but unfortunately this function doesnt work for me mauro72 :
any other ideas?
here is my submit function
using pressflow 6.17.85 and jquery_ui 1.7.3 and automodal
thx for helping!
Comment #10
mfer commentedin automodal_add() pass in automodalReload as TRUE and the page will refresh.
This went in as part of an extensible behavior for onSubmit handling.
Comment #12
lelizondo commentedThis is my working example, thanks.
Comment #13
rwohlebLooking through the automodal JS it looks like you can handle this just with URL parameters. The automodal settings code just adds these parameters to the URL passed to modalframe anyways.
Before:
After:
Comment #14
gmclelland commentedNoob question, but how do you construct a link like
<a class="automodal" href="/foo?automodalReload=true">foo</a>using the drupal l function? Everything I try doesn't work.Thanks,
-Glenn
Comment #15
keesee commentedLove this module. I've used it for displaying content for some time and it works great. I recently used it for 2 forms as it seems to be working work. The one thing that bugs me is that it shows you a flash of content in the iframe before closing and reloading the page. has anyone found an elegant solution to keep this from happening?
Thanks in advance.
Comment #16
gmclelland commentedAnybody looking for a solution to #14, the answer is here:
http://drupal.org/node/1070722#comment-4151078
Hope that helps someone,
-Glenn
Comment #17
zatarain21 commentedThanks a lot rwohleb (Post 13), that solution works for me.
An easy way to use is make a view that list a post of cckcontent
Then in the header of the view write this:
The result is cool, in this way the user create content in a modal frame and see the result in the list after post.