AHAH helper 6.x-2.2
File ID: 98238
AHAH helper 6.x-2.2 Description
Description: Drupal 6's Forms API is great, but its AHAH support (a technique similar to AJAX) is lacking. You have to write a menu callback for every AHAH-enabled form item of your form. This is time consuming, hard to maintain and hard to write tests for. Not to mention that the code for those menu callbacks is not easy to understand, yet always the same. ("What's that piece of code for?" d-deOCt "I'm not sure, it's just necessaryd-deTZ") See my blog post about this if you want more details: http://wimleers.com/blog/ahah-helper-module.
Notes about version 2
Version 2 of this module simplifies the usage a lot and contains a much improved example. My blog post is slightly outdated: in version 2, the #first_time property no longer exists: it was too cumbersome to use. Instead, validation is only performed when a button is pressed, not when an AHAH event fires because of a changed select, for example. See this issue for details.
It allows you to:
1. not write any menu callback at all.
3. have a sole, central form definition function that has some if-tests to support a changing form based on the user's input, i.e. by checking $form_state['values'] and/or $form_state['storage']. This is in fact the exact same system you've been applying if you've already written multi-step forms. This makes sense, because AHAH forms are in fact normal multi-step forms, that just happen to be updatable through AHAH as well.
You still have to use the #ahah property and set a wrapper, but you provide a "magical path" that will automatically rebuild and render the desired part of the form. If the part of the form that you want to be rendered is $form['fapi']['rocks'] then you would do 'path' => ahah_helper_path(array('fapi', 'rocks')) and that's it.
4. skip form validation for all AHAH updates that do not call validate or submit callbacks.
5. have new AHAH-powered form items added in an AHAH callback (previously not supported).
Look at the included ahah_helper_demo module for an example.
Related: Buttons, Write, you039ve, Tests, ahahpowered, callbacks, Callback, Button, vascript, Forms, Module, Property, enabled, Version
O/S:BSD, Linux, Solaris, Mac OS X
File Size: 10.0 KB
|More Similar Code|
This is a helper module that allows the returned data from an AHAH callback to specify the function to be called. It also allows an additional function to be called before AHAH submission. This module is used by the Autotag module.
Development of this module was carried out by Ben Scott, with minor additional development by Simon Rycroft and funded in part by the EDIT Scratchpads project
This helper class gives easy access to callback event data in GUIs developed using GUIDE. Several Handle Graphics callback functions, such as the uicontrol's KeyPressFcn and the figure's WindowScrollWheelFcn, pass useful information through the...
Tweetbacks Helper is a helper Plugin for Tweetbacks Plugin to help it detect more tweets.
This Plugin can disable Pseudo cron scheduler by Tweetbacks and replace it with its own scheduler, that can be invoked by...
Without this module, if during the processing of an AHAH callback, css files are added using drupal_add_css() but those files aren't already loaded on the base page from which the AHAH request originated, then those files don't get loaded. This is...
This module provides a way for modules to store information about the state of a page as it changes during AHAH callbacks. It provides no end-user functionality, but gives an API for other modules to use. Examples of modules using this are...
Mail Merger Helper simplifies the process of Mail Merge in Microsoft Word by allowing the user select a data source file and a MS Word document in the same screen.
This is a helper module for the DrupalMU installation profile.
Since DrupalMU has been replaced and is no longer maintained, this helper module isn't either.
The maintenance helper provides features to assist site admins in performing maintenance on their site. It provides a permission to login and allows admins to set a configurable message to appear on all pages of the site.
|User Review for AHAH helper