From: Bart Jooris on
Dear all,

I derived a job management page from the tabbed.php that comes with the
HTML_QuickForm_Controller package.
We observed that all the objects (controller, pages,...) are
reinstantiated TWICE every time a user toggles to another tab AND during
the second reload all the hidden field info gets lost.
In my application an user can manage multiple jobs at the same time and
I wanted to use a hidden field to store a sub_session_id but it seems
that I can not rely on the hidden field info.

Does anyone have experience with hidden fields in combination with the
controller or
maybe a better way to accomplish my goal?

Thanks a lot,

Bart Jooris


From: Alexey Borzov on
Hi Bart,

See? It isn't that difficult to quit abusing bug tracker and write to a
mailing list instead!

On Mon, 23 Nov 2009 10:45:12 +0100, Bart Jooris <Bart.Jooris(a)ugent.be>
wrote:
> I derived a job management page from the tabbed.php that comes with the
> HTML_QuickForm_Controller package.
> We observed that all the objects (controller, pages,...) are
> reinstantiated TWICE every time a user toggles to another tab AND during

> the second reload all the hidden field info gets lost.

When you click on a button, it goes like this:
form is submitted (usually via POST, that is first request) -> data is
saved in session -> redirect to a new form page (this is second request).
It is done that way so that browser's "Back" and "Forward" buttons will
work without asking you to resubmit the data each time.

> In my application an user can manage multiple jobs at the same time and
> I wanted to use a hidden field to store a sub_session_id but it seems
> that I can not rely on the hidden field info.

Redirect is done by 'jump' action handler, by default it only passes the
new form name and (sometimes) session ID. If you want to pass additional
data, you'll have to write your own 'jump' handler (maybe extending the
default one) that'll know about such data. You'll also have to submit your
'sub_session_id' with each form and process it (here hidden fields will
work).

> Does anyone have experience with hidden fields in combination with the
> controller or
> maybe a better way to accomplish my goal?

This is a common issue with current Controller, I'm currently designing a
port of Controller for HTML_QuickForm2 that will hopefully allow such usage
"out of the box".