I'm trying to show a view with exposed forms within a popup, the forms are shown but when I apply the filter, nothing happens.

if I use ajax, I'm redirected to the page view after applying the exposed form.

any help?

CommentFileSizeAuthor
example.jpg57.26 KBreych9

Comments

tunic’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Category: Bug report » Feature request
Priority: Major » Normal

I've tested a View with exposed filter in a popup and works as expected. You must enable the View's Ajax mode. Check you don't have any jQuery errors.

tunic’s picture

Category: Feature request » Support request

Oops, fixing category.

reych9’s picture

I am doing this:

function ucistore_form_alter(&$form, $form_state, $form_id) {
if ($form['#form_id']=='aporte_node_form'){
	 module_load_include('inc', 'popup', 'includes/popup.api');
         $rendered =popup(array('php' => "return views_embed_view('aportes', 'default');", 'activate' => 'click', 'ajax' => 1)) ;
	$form['title']['#prefix']=$rendered;
}}

I am trying to insert a popup into a form using hook_form_alter() and definitely don't work for me.

Did you tried that?

thanks

tunic’s picture

Status: Active » Fixed

I think the problem is you add the view in the alter.

Check this FAPI Workflow Illustration:
https://drupal.org/node/165104

The alter is executed in the prepare stage, so when you submit the filter the alter is not run (because form is in cache, see ajax_form_callback on the right side of the picture), hence the view is not updated.

Try to add the view using a after_build function (in the build stage).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.