Content - News Menu - Ressources Menu - Sitemap - Share your code - Code library - Reference
Formidable is part of the TYPO3 Project and is supported by Ameos
crdate : 2008/04/29
by : Manuel Rego
in : Tips and Tricks
This article will show how to use a form inside a renderlet lister with FORMidable.
We will need to use last SVN revision 182 or higher.
We will have to use property activelistable for the columns that we can show as a form.
<column name="title" listHeader="title" type="renderlet:TEXT" activelistable="true" />
And we will need a button in a colum to can submit information.
<column name="save" label="save" type="renderlet:BUTTON">
<onclick runat="server" params="uid" submit="full" when="after-init-datahandler">
<userobj>
<extension>this</extension>
<method>_editPage</method>
</userobj>
</onclick>
</column>
We need to define a function to read values submited by form. In this function we will read POST variables and we are going to receive an array for each colum defined as form (marked as activelistable). We will have to do database modifications manually.
function _editPage($aParams, $oForm) {
$postArray = t3lib_div::_POST($oForm->formid);
$titles = $postArray['pages:title'];
//t3lib_div::debug($titles);
$GLOBALS['TYPO3_DB']->exec_UPDATEquery('pages', 'uid="' . $aParams['uid'] . '"', array('title' => $titles[$aParams['uid']]));
}
In the next files you can see a full example that shows a list of pages, where you can edit page title (inside a lister) and save this change.
