[TYPO3-mvc] Problem with <f:form.submit> and <<f:form>

Steffen Müller typo3 at t3node.com
Mon Aug 2 16:28:40 CEST 2010


Hi.

Am 02.08.2010 10:38, schrieb Phong Nguyen Huy:
> it render 2 buttons, when i click on the button, they always to call
> createAction function in Controller
> But i want to each button will call an other action in the Controller. How
> will i do?

I do not have a solution, but try to help analyzing the problem:

Putting the action into the submit form element does not work. Here's
why: While the action is a plain GET parameter, button values are POST
parameters, which are prefixed with the name attribute of the form tag.
So if you try something like this:

<f:form method="post" action="create" controller="Blog" name="newBlog"
object="{newBlog}">
...
<f:form.submit property="action" value="create"/>

to override the action with the submit button, you'll probably end up
with a parameter:
tx_blogexample_pi1[newPost][action]=create

But the requestBuilder object pulls the action from:
tx_blogexample_pi1[action]=create

I don't know a solution to make this work out of the box. If you strip
the name attribute from the form viewhelper, POST paramters are broken.

If nobody objects and gives advise to solve this problem - would you
mind opening a ticket on http://forge.typo3.org/projects/typo3v4-mvc/issues


-- 
cheers,
Steffen

Twitter: @t3node
TYPO3 Blog: http://www.t3node.com/
Latest Blog article:
http://www.t3node.com/blog/combining-fluid-viewhelpers-and-typoscript-in-typo3-5-basic-examples/


More information about the TYPO3-project-typo3v4mvc mailing list