[support] D7 Multistep Form with Pager

Fred Jones fredthejonester at gmail.com
Fri May 27 15:25:00 UTC 2011


I have a custom module with a form and it works fine with multistep--I
found a tutorial somewhere how to do that.

But I need it to be filtered by the user and paged. Just like the
admin/content page we all know and love.

I see that the pager links do not contain the filter settings--they
are just ?page=7 etc. I found in node.admin.inc that the filters are
kept constant by inserting them into $_SESSION and then referencing
them later.

Is that the way to do it? I'm confused because in D6 my pager links
would end with :

?page=4&begin_date[month]=5&begin_date[day]=27&begin_date[year]=1993 etc.

IE the filter settings were in the URL. Is there something I am
missing to get that to work?

While I'm here I will mention that in D6 I used this:


  $form['searchparams']['begin_date'] = array(
    '#type' => 'date',
    '#title' => 'Begin Date',
    '#default_value' => $form['post']['begin_date']
  );

to get my filters to remain after the submit. I changed one line:

    '#default_value' => $form_state['input']['end_date'],

for D7 and it works. Is that the right way?

Any light you can shed on this topic is appreciated. I have been
Googling and reading but a push in the right direction would
help--this is my first foray into D7 FAPI. :)

Thanks!


More information about the support mailing list