Thank you, Tobias, for the help. I did find out about the token and state in 
the meantime. With the following Freemarker hack, I can list the submitted form 
values:

[#assign formState = 
ctx.request.session.getAttribute('info.magnolia.module.form.engine.FormEngine-formState-'
 + ctx['mgnlFormToken'])]

Values:
[#assign keys = formState.getValues()?keys /]
[#list keys as key]
        - ${key} = ${formState.getValues()[key]}<br />
[/#list]

The funny thing now is, that this will give me something like:

- key = value__value

Does anyone know what that "value__value" is all about?

Thanks!
-will


On 11.03.2011, at 14:30, Tobias Mattsson wrote:

> 
> Hi Will,
> 
> The submitted values are kept in session keyed with a special token. The 
> token is passed as a request parameter each time so you can see it as a 
> hidden input in forms and directly in the address bar.
> 
> The object held in session is FormState [1], it has a method called 
> getValues() to access the collected values.
> 
> There's a utility class called FormStateUtil that has two methods that you 
> should find useful. getFormStateToken() returns the token (the request 
> parameter) for the current request and getFormState(String formStateToken) 
> returns the FormState object.
> 
> [1] 
> http://svn.magnolia-cms.com/svn/community/modules/magnolia-module-form/trunk/src/main/java/info/magnolia/module/form/engine/FormState.java
> [2] 
> http://svn.magnolia-cms.com/svn/community/modules/magnolia-module-form/trunk/src/main/java/info/magnolia/module/form/engine/FormStateUtil.java
> 
> Cheers,
> Tobias
> 
> On Mar 11, 2011, at 10:27 AM, Will Scheidegger wrote:
> 
>> 
>> Dear Magnolians
>> 
>> Yesterday I gave the multi-step forms the first try and I was surprised at 
>> how easy it was to set one up (thanks to the video). But from the 
>> documentation I could not tell how to access the form values submitted in 
>> the previous steps. I would like to display a "preview" page as a last step 
>> before final submitting of the form. 
>> 
>> Is there a session object one can access?
>> 
>> Thanks!
>> -will
>> 
>> 
>> ----------------------------------------------------------------
>> For list details see
>> http://www.magnolia-cms.com/home/community/mailing-lists.html
>> To unsubscribe, E-mail to: <[email protected]>
>> ----------------------------------------------------------------
> 
> 
> 
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
> 



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to