this code work but the views is callback only once (reload only once), any idea to reload more than one time ?
function modulename_form_alter (&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'form_id_of_your_afb_form':
$form['#validate'] = array();
$form['ajax-submit']['#ajax']['callback'] = 'modulename_create_callback';
}
}
function modulename_create_callback($form, &$form_state) {
// load view
$view1 = views_embed_view('view_name','view_display_name',$view_arguments_as_required);
// replace the afb form with a clean form
$newform = afb_ajax_handler($form, $form_state);
$commands = array(
ajax_command_replace('#target_div_id_of_view_to_update .view',$view1),
ajax_command_replace('#target_div_id_of_afb_form_to_replace',render($newform)),
);
$form['#type'] = 'ajax';
$form['#commands'] = $commands;
return $form;
}