Closed (won't fix)
Project:
Examples for Developers
Version:
7.x-1.x-dev
Component:
AJAX Example
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Jun 2012 at 08:13 UTC
Updated:
30 Jul 2017 at 20:45 UTC
Jump to comment: Most recent
Comments
Comment #1
jhodgdonMoving to Examples project.
Comment #2
rfayIf you *have* to use 'path', the AJAX Example 6.x might lead the way for you.
My intention in the AJAX Example was that nobody ever be exposed to having to use 'path', which is really only for very unusual advanced usages. Or retro. We tried to get away from that in D7.
I'm putting this "won't fix" unless you have a strong case for teaching people about 'path'. I really don't want them to know :-)
Comment #3
patpluspun commentedI've been trying to implement ajax functionality on a multiple select form for a few days now with zero success. I am trying to provide a disambiguation form for a multiple select taxonomy, so that the editor can choose a "primary" term to collect further information from on node render. It would really be helpful to have documentation for Drupal 7's #ajax['path'] so that I can skip default field validations before my callback fires (which currently, unless I hack taxonomy_field_validate, there is simply no way to pass correct values to the validation function).
I implore you, please provide an example. The counselor who counsels ignorance betrays his own station, after all.
Comment #4
technicalknockout commentedwtf? I've never before seen someone make the case for LESS documentation! And how is anyone supposed to know if they *have* to use it if it's not clear what it does? How is anyone supposed to make a "strong case" for something before they understand it clearly? That's absurd! As if the drupal learning curve wasn't hard enough... now you also have to convince the gatekeepers the information they have is relevant!
Anyways... looking at the 6.x example, it looks like whatever 'ajax[path]' callback function you set has no context whatsoever from the ajax framework. It's just a plain hook_menu implementation, so you get to implement it! The example module has its 'ahah_example_callback_helper' module which shows how to get $form & $form_state variables. The example is for drupal 6.x of course, so good luck implementing for 7.x!
Comment #5
mile23If you want to contribute a patch, please hop on in. :-)
Comment #6
technicalknockout commentedI would love to submit a patch to show how the API is supposed to work :-) ... however, I can't quite get it do what I want. I might not be the best one to show how it's supposed to work here. I'm not even sure if it's the right thing for the functionality I'm currently working on...
Comment #7
mile23This issue does not have a patch, so I'm closing it based on the D7 Examples roadmap: #2642596: D6, D7 Roadmap for Examples
If anyone wants to take it on, you're welcome to re-open this issue with code.
Comment #8
hondaman900 commentedPutting in another appeal here for an example by those who know how to use
#ajax['path'].I'm sure my module case must be a common one. I pass the ID of an entityform as a parameter in the URL to a form so that I can pre-populate data in the form textfields. I use AJAX to trigger code based upon the textfield content changing. However the AJAX default path (system/ajax) is being introduced and my form is bombing because it loses the passed argument when AJAX is triggered. No real helpful errors at that point. Trying to set the argument as a global variable doesn't help.
I would refute statement in #2:
It would seem that
#ajax['path']could solve this for me, but I can't find a good example showing how to implement this and the documentation is not clear enough to apply to my case. A working example would be invaluable to me right now - I'm sure I'm not alone.