Doing forms with Views is tricky, because ordinarily a form really likes to own the whole page. But they don't have to. We don't have to use drupal_get_form, and I don't think we have to even use the drupal builder function.
Instead, what we need to do is use drupal_prepare_form and drupal_process_form and do a little song & dance to make sure that everything that's supposed to happen in drupal_get_form actually happens.
To do this, Views needs a completely new handler type: A 'form' handler. I realize this handler would like settings; so would all of the handlers. Unfortunately, at best you can have a text 'option' field or something where something can be filled in; but I don't think we should even have that.
This handler needs to specify a builder function that accepts a view and a $nodes array. The builder function must iterate across the fields in the view and, if they have a 'form' attribute, call that. This is used to create the $form['foo'] = array() structure. This builder eventually returns a $form. This must be placed on the $view object.
It should also have a validator so that it can ensure that necessary fields exist, if it chooses. It should also ensure that only plugins that 'need fields' are added, since this is going to rely on the field handlers to render the form bits.
The database needs to be modified to create a field for the new handler. This field is like the _type fields, so there needs to be one for page_ mode and for block_ mode. Views UI then needs to be modified to utilize these fields. It MUST allow a 'no form' handler.
views_build_view then needs to be modified; if there is a form handler attached, after the query is run and a $nodes array is generated, it needs to call the form builder function. In theme_views_view, drupal_render($form) must be called sometime after all rows have been rendered to catch any other parts of the form. Alternately, the form handler could provide 2 functions; a handler to render part of the form prior to the rows being rendered, and a handler to render the rest of the form at the end.
Finally, any field handler which handles a form item must have the additional 'form' handler so it can build its form, and its render handler must drupal_render the appropriate $form gadget. We have to make sure references are carried through so that the $form gets marked as #printed and stays that way. Losing references can cause double rendering at the end.


an alternative
lots of work has gone into the views form element. would be nice to build off that. see http://drupal.org/node/103171. an example use of that is the vies bulk operations module: http://drupal.org/project/views_bulk_operations
This is actually the
This is actually the direction the views form element needs to go.
The views form element tries to do the form as a style plugin, and that turns out to be the wrong way to do it, in my opinion; this post was intended as a guideline for Harry on where to take that patch so that it can get committed.
I'm on it
Views/form functionality is a required component of the project I'm currently working on, so I'm highly motivated to get this feature into views.
However, prior to this effort, I've only used views via its API and Views UI, so I need to dig deeper into views code to tackle this one.
Anyone with a thorough understanding of how views works internally who is interested in helping out, contact me or post a comment to the issue opened for this.
Post new comment