Hallo,
möchte gern nach dem Anlegen einer neuen Nachricht eine Weiterleitung auf die showAction. Es kommt jedoch folgender Fehler:
#1217839467: Could not ultimately dispatch the request after 101 iterations. Most probably, a @dontvalidate annotation is missing on re-displaying a form with validation errors.
New.html
<f:form method="Post" controller="Posts" action="create" name="newPosts" object="{newPosts}">
<label for="postTitle">Titel</label>
<f:form.textfield name="postTitle" property="postTitle" /><br>
<label for="forumsId">ForumsID</label>
<f:form.textfield name="forumsId" property="forumsId" value="{forum.uid}"/><br>
<label for="forumsId">Text</label>
<f:form.textarea name="postText" property="postText" rows="20" cols="46" /><br>
<f:form.submit value="Speichern" />
</f:form>
PostsController.php
/**
* action show
*
* @param Tx_MyForum_Domain_Model_Posts $posts
* @return void
*/
public function showAction(Tx_MyForum_Domain_Model_Forum $forum, Tx_MyForum_Domain_Model_Posts $posts) {
$this->view->assign('posts', $posts);
$this->view->assign('forum', $forum);
}
/**
* action new
*
* @param Tx_MyForum_Domain_Model_Posts $newPosts
* @dontvalidate $newPosts
* @return void
*/
public function newAction(Tx_MyForum_Domain_Model_Forum $forum, Tx_MyForum_Domain_Model_Posts $newPosts = NULL) {
$this->view->assign('newPosts', $newPosts);
$this->view->assign('forum', $forum);
}
/**
* action create
*
* @param Tx_MyForum_Domain_Model_Posts $newPosts
* @return void
*/
public function createAction(Tx_MyForum_Domain_Model_Posts $newPosts, Tx_MyForum_Domain_Model_Forum $forum) {
$this->postsRepository->add($newPosts);
$this->flashMessageContainer->add('Your new Posts was created.');
#$this->redirect('list','Forum');
$this->redirect('show', NULL, NULL, array('posts' => $newPosts));
#$this->forward('show', 'Posts', NULL, array('posts' => $newPosts));
}
Gruss
mimaxx