Closed (duplicate)
Project:
Asaf (ajax submit for any form)
Version:
7.x-1.1-rc1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Aug 2013 at 08:17 UTC
Updated:
30 May 2014 at 17:35 UTC
Jump to comment: Most recent
Comments
Comment #1
taldy commentedHello,
First of all I want to say that our first and main goal during developing asaf was not to break anything. So if after node saving without asaf browser change the page and show the message, asaf should to do the same.
According your request...
1. Unfortunately currently you can't stop redirect/refresh from UI. If you really want to disable redirect/refresh you should implement HOOK_asaf_form_ajax_commands_alter or HOOK_asaf_form_FORM_ID_ajax_commands_alter in your custom module and remove entry which has command property equal 'asafRefresh'/'asafRedirect' . If you need more information about this, please let me know.
2. But you raised interesting questions about messages showed before redirect. It looks a little bit senseless showing messages right before redirect/refresh. I think I should support showing messages after redirect/refresh in case like node saving.
Regards,
Comment #2
pjmuszynski commentedHi,
How can I use these callbacks? I mean what parameters it takes and what should return?
I can't see any usage of this in example module... :(
Thanks in advance.
Comment #3
taldy commentedHi,
You can use one of the following hooks:
or
In both variants you'll get $commands variable by reference, and you can do whatever you want with it.
Comment #4
pjmuszynski commentedthank you, it's very useful info :)
Comment #5
klucid commentedHello,
First of all, thanks for your work on this module. I'm sorry, but I am very new to AJAX and hooks. I just need some help getting the form to submit without a page refresh/redirect.
Is it possible to add this function to my theme's template file instead of a custom module?
If my form ID is "link_node_form" should my hook be something like below?
What is an example of what I should do with the $commands variable to stop the page refresh/redirect?
Thank you so much for your time.
Comment #6
apmsooner commentedSee comment #1 for solution here: https://drupal.org/node/2277137