I won't have a chance to look at this tonight, but just a comment that is probably irrelevant:
It's highly unusual to set #tree on a portion of a form rather than the whole form. #tree makes $form_state['values'] have its values in a hierarchical, rather than flat, arrangement, and it's not clear why you would want that. It's also rather dangerous to mess with #tree when you're form-altering, as it changes what will happen for other participants in the form.
One thing you should make sure to check: Is ahah.js being loaded on the page? Just check with firebug. If it's not, you may have to load it explicitly.
-Randy
Next issue. My callback isn't being hit when I change the value in the master dropdown. I have the code below...simplified, albeit apparently wrong. Unlike the examples, the #ahah being added to the field does not result in any ahah references in jQuery.extend(Drupal.settings.
function test_menu() {
$items = array();
$items['test/dropdown/callback'] = array(
'page callback' => 'test_do_callback',
'type' => MENU_CALLBACK,
'access_callback' => TRUE,
);
return $items;if ($form_id == 'test_profile_node_form') {
}
function test_form_alter(&$form, &$form_state, $form_id) {
$form['field_two']['#prefix'] = '<div id="field-two-wrapper">';
$form['field_two']['#suffix'] = '</div>';
$form['field_master']['#ahah'] = array(
'path' => 'test/dropdown/callback',
'wrapper' => 'field-two-wrapper'
);
$form['field_master']['#tree'] = TRUE;
}
}
function test_do_callback() {
// do stuff here
}