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

Thomas Nussbaumer typo3 at thomasnu.ch
Tue Apr 30 10:25:46 CEST 2013


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



More information about the TYPO3-project-typo3v4mvc mailing list