[TYPO3-dev] Ajax call cache the wrong view when submitting form
Olle Haerstedt
o.haerstedt at bitmotion.de
Mon Sep 22 15:08:24 CEST 2014
Hello!
I have a form. In the form there are select boxes. When a select box is changed,
an Ajax is called to render new options. The Ajax action is projectentryChangeAction().
It has a view. When submitting, the action createProjectentryAction() is called. This
action does not have a view, but is redirected to the indexAction(). createProjectentryAction()
does a validation on an argument. When the validation fails, the _wrong_ view is
displayed, the view from projectentryChangeAction(). But this wrong view is only
rendered when one or more Ajax calls have been done.
This is what happens:
1. view index is rendered
2. view projectentryChange is injected using Ajax
3. submit form, action createProjectentry is called, which fails validation
4. view projectentryChange is rendered <-- Wrong! Should be index view because of redirection in createProjectentryAction()
Another path of exection, without Ajax:
1. view index is rendered
2. submit form, action createProjectentry is called, which fails validation
3. index view is rendered with validation error messages
Submitting the form is not done using Ajax.
When using Ajax and the validation succeeds, the correct view is rendered.
Grateful for any help or tips
Regards
Olle
More information about the TYPO3-dev
mailing list