[TYPO3-mvc] Extbase / Fluid Form Viewhelper: Only want to change one property of object

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Tue Apr 30 14:52:38 CEST 2013


Hi Thomas,

that's a very helpful idea, thanks a lot! I will use this the next time. 
Meanwhile I just did send the "sort" param as only argument like
<a class="sort inc" href="{f:uri.action(additionalParams:{order:1})}">▲</a>

The demand object is stored to the user session and stays untouched.

Cheers,
Till

On 04/30/2013 10:25 AM, Thomas Nussbaumer wrote:
> Hi, I call for such modifications directly to the action "update" in 
> the contoller. Fx switching the sort flag:
>
> public function updateAction(Tx_Myext_Domain_Model_Demand $demand, 
> $modify = '') {
> if ($modify === '') {
> ...
> } else {
> switch ($modify) {
> case 'sort':
> $demand->setOrdering($demand->getOrdering ? '0' : '1');
> break;
> case 'xxxx':
> ...
> }
> }
> $this->redirect(...);
> }
> Hope that helps. Cheers, Thomas
>
> Am 17.04.2013 19:04, schrieb g4-lisz at tonarchiv.ch:
>> Hi there,
>>
>> I have a object 'Demand' with a lot of properties, e.g. string
>> 'fulltext' and integer 'ordering'.
>>
>> Now there is a form where I want to change just one of it's properties
>> (others of them have been set in an earlier step):
>>
>> <f:form name="demand" object="{demand}" action="...">
>> <f.form.hidden property="ordering" value="1">
>> </f:form>
>>
>> If i do so, all other properties are lost. If i want to keep another
>> property 'fulletxt', i have to put it in a hidden field, too:
>>
>> <f:form name="demand" object="{demand}" action="...">
>> <f.form.hidden property="fulltext">
>> <f.form.hidden property="ordering" value="1">
>> </f:form>
>>
>> Because I have a lot of properties and because I don't know which one of
>> them are set, a had to put a whole bunch of hidden properties in the
>> form. This is quite impractical.
>>
>> Is there a way to tell the form handler that it should keep all
>> properties, without explicitly listing every property?
>>
>> Cheers,
>> Till
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list