[TYPO3-mvc] Fluid - Setting an attribute in viewHelper by condition
Daniel Lienert
lienert at punkt.de
Thu Aug 19 15:35:06 CEST 2010
Hello list,
i wonder if it is possible to set a viewhelper attribute by an inline
if-Viewhelper condition.In the following example, i want to set the
additionalAttribute "onchange: submit()" conditional by an object property:
<f:form.checkBox name="name" value="value"
additionalAttributes="{f:if(condition: {object.submitOnChange} then:
'{onchange : 'submit()'}')}" />
<f:form.checkBox name="name" value="value"
additionalAttributes="{onchange : {f:if(condition:
{object.submitOnChange} then: 'submit()')}}" />
But both variants produce the error #1237900529: The argument
"additionalAttributes" was registered with type "array", but is of type
"string" in view helper "Tx_Fluid_ViewHelpers_Form_CheckboxViewHelper".
Is there any posibility to do this?
Thanks in advance,
Daniel
More information about the TYPO3-project-typo3v4mvc
mailing list