[development] groking ajax callbacks
Augustin (Beginner)
drupal.beginner at wechange.org
Tue Jan 1 10:37:30 UTC 2008
Neil, Earl, Peter, all,
thanks for your replies.
I have added your various links in the API section of the handbook:
http://drupal.org/node/205296
As far as book.module is concerned, the bit that I missed was the
#ahah part in the form:
// Add a drop-down to select the destination book.
$form['book']['bid'] = array(
'#type' => 'select',
'#title' => t('Book'),
'#default_value' => $node->book['bid'],
'#options' => $options,
'#access' => (bool)$options,
'#description' => t('Your page will be a part of the selected
book.'),
'#weight' => -5,
'#attributes' => array('class' => 'book-title-select'),
'#ahah' => array(
'path' => 'book/js/form',
'wrapper' => 'edit-book-plid-wrapper',
'effect' => 'slide',
),
);
I found out that the #ahah attribute is completely undocumented, so I
added a placeholder for it in the FAPI reference:
http://api.drupal.org/api/file/developer/topics/forms_api_reference.html#ahah
(my addition might take a few hours to appear).
It's only a placeholder though. Someone more knowledgeable needs to
complete the doc, there. If nobody does it, at least developers would
be made aware that there is such a thing as #ahah in FAPI.
Is that something new in Drupal 6 ?
[edit: it seems to be. It is mentioned in a very unlikely place:
http://drupal.org/node/114774#choice_check .
Why not in Peter's AJAX page?]
Blessings,
Augustin.
More information about the development
mailing list