In Wim's blog, he identified a set of flaws with AHAH forms. Specifically:
"3.If new AHAH-enabled form items are added during an AHAH callback, they don’t work, because Drupal.settings doesn’t get updated."

I have a page which is essentially a grid of < d iv>s. Clicking on a "cell" uses AJAX to load the appropriate form for that cell's content and display it in an overlay < d iv>. (I know this isn't exactly "Web2.0", but some of the content is to complex for direct inline editing.)

For example, one cell type is "narration". This contains a block of text. As part of my system's functionality, this text block can be exported as another type of data: Text Event (which has additional fields). My narration form has a checkbox:"export_as_event" which, when clicked, does it's AHAH "magic" and displays the additional fields.

If I just display the node edit page, the AHAH call works fine.

The problem I have is that none of the AHAH elements in this AJAX-loaded form trigger an AHAH call. Using firebug, I can see the AJAX call to retrieve the form, but when I toggle the checkbox, nada. ...no AHAH call, no errors, n.a.f.t. to tell me what is or isn't happening...

My assumption is that there's some jQuery functionality that isn't getting called when my form is returned via AJAX. As such, I assume that the AHAH element is not getting registered and, so, doesn't trigger the AHAH call.

Again, assuming... I'm guessing the problem lies in the jQuery binding routine. ...the AHAH binding routine was probably written before the jQuery live() method was available and so, cannot register the AHAH functionality on newly rendered form elements.

...'course this is just a WILD guess.

How is Wim's flaw #3 allegedly dealt with? ...'cause it's still not working for me. Is there some JS call I can make to ensure my new elements get the correct AHAH bindings?

Comments

PrplPplEtr’s picture

Project: AHAH helper » Drupal core
Issue summary: View changes

fixing tags for legibility

vinoth.3v’s picture

Project: Drupal core » AHAH helper

same issue here
any update?

vinoth.3v’s picture

Project: AHAH helper » Drupal core
Version: 6.x-2.2 » 6.x-dev
Component: Miscellaneous » ajax system
SGhosh’s picture

Finally finally found the problem i was looking for....
unfortunately not with its answer!! :/

Anonymous’s picture

I have a similar problem. Has anyone come across a solution?

SGhosh’s picture

This problem does remain, but you should totally use the AHAH helper module for ahah in forms. Its awesome. It actually makes using ahah in forms so simple it feels there must be something wrong! ;)

It will help. Do use it. All the best. :)

SGhosh’s picture

Issue summary: View changes

another tag fix

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.