[TYPO3-mvc] passing on demand object to various views/formats

Thomas Allmer at at delusionworld.com
Fri Feb 25 14:40:45 CET 2011


hey,

I have a list of products with multiple filters for different product 
properties using a demand object much like in "sjr_offers" and it works 
like a charm.

Now what I also have is a different "layout" for this list. The default 
list just shows some information and there should be also a full table 
layout. I used a different format for it[1], so I have list.html and 
list.table. Now what I need is a switch link or button to easily access 
both views whenever needed.

I currently do this with
<f:link.action action="list" format="table">as table</f:link.action>
and I get the right layout. However on both layouts you have the same 
filters available so when switching views the selected filters and the 
output lust should stay the same. For that I have to pass on the current 
selected filters... which is basically the demand object.

Now I have basically three possibilities right?
1) pass all demand object properties via get as a link

I tried that with just the years and the link looks good but I get the 
following Exception "#1255082824: Request hash (HMAC) checking failed. 
The parameter __hmac was invalid or not set, and objects were modified."

<f:link.action action="list" format="table" 
additionalParams="{demand.fullArray}">as table</f:link.action>

public function getfullArray() {
   return array('tx_cdglabors_labors[demand][years]' => $this->years);
}

even if I change the forms to use get and set the addQueryString to true 
with
<f:link.action action="list" format="table" addQueryString="true">as 
table</f:link.action>
I get the same exception... so I guess I have to somehow update the hmac 
link manually... or can I just disable/ignore it (for the sake of nicer 
urls)... any hints?

2) don't use a link but a full form with all current properties of the 
demand object as hidden inputs and a button

haven't tested but seems a little too much... it should be easier :p


3) save the demand object in a session

I would like to avoid that...


So if you have any hints or other solutions please let me know :)
thx


Another info... I will also have to pass it on to the detail view as 
there will be a "go back to current filtered list" button...

[1]: maybe later using something like Peter Niederlag posted on this 
newsgroup under "Re: [TYPO3-mvc] different layout tempaltes for same 
action/controller"

-- 
+---------------------------------+-----------------------------------+
| Thomas Allmer                   |   http://www.delusionworld.com    |
| E-mail: at at delusionworld.com    |   phone: +43 699 16217064         |
+---------------------------------+-----------------------------------+


More information about the TYPO3-project-typo3v4mvc mailing list