[TYPO3-project-formidable] Message after data have been saved in the DB
Izzie Greys
izzie.greys at gmail.com
Fri Jul 11 10:22:43 CEST 2008
Hi Luc,
Thanks to you I solved my first problem :) Now if data are wrong I'm not
redirected to the list. Thank you very much, it works fine.
However I still have the second problem. I used this code in the php section
:
echo( "<script language=\"javascript\">alert(\"Data saved\");</script>" );
It's ok the message is shown if data are good, but I have the javascript
message, an error on the page and nothing else. I don't go back to the list.
The error is :
*"Warning*: Cannot modify header information - headers already sent by
(output started at
C:\wamp\www\typo3conf\ext\ameos_formidable\api\class.tx_ameosformidable.php(4986)
: eval()'d code:4)
in*C:\wamp\www\typo3conf\ext\ameos_formidable\api\base\act_redct\api\class.tx_actredct.php
* on line *44*
I think it's because the code is not inserted in my main page but I don't
know how to solve the problem.
Have you any idea ?
Thanks again
Regards
Izzie
2008/7/9 Luc Muller <l.mul-nospam-ler at ameos.com>:
> Hi Izzie
>
> You should have a look at actionlets
>
> those should be placed inside the <control> tag
>
> <actionlets> are process at the end of all the process this means after
> data are inserted in the DB
>
> you can either use :
> <actionlets>
> <actionlet:USEROBJ>
> <userobj>
> <php><![CDATA[/*<?php*/
> //here you can paste so code to do stuff after
> datas are inserted in DB
> // you can retrieve stored data using :
> $aData = $this->oDataHandler->getStoredData();
>
> return false;
>
> /*?>*/]]></php>
> </userobj>
> </actionlet:USEROBJ>
> <actionlet:REDIRECT>
> <pageid>
> here you can input directly a page id OR
> <userobj>
> <php><![CDATA[/*<?php*/
> // you can use an userobj to redirect to a
> more advanced url.
> return $this->cObj->typolink_URL(
> array(
> "parameter" => 1,
> "additionalParams" => "",
> "returnLast" => "url",
> "useCacheHash" => "1",
> )
> );
>
> /*?>*/]]></php>
> </userobj>
> </pageid>
> </actionlet:REDIRECT>
> </actionlets>
>
> Hope this helps
>
> Luc =:0)
>
> Izzie Greys a écrit :
> > <typo3-project-formidable at lists.netfielders.de>Hey,
> >
> > I'm trying to use a submit button on my edit/create users form with a
> > message "User saved" if the data are ok before return to my users list.
> Here
> > it's what I have done :
> >
> > <renderlet:SUBMIT name="btn-save" label="Save">
> > <onclick runat="server">
> > <userobj>
> > <php><![CDATA[/*<?php*/
> > $sLink = $this->cObj->typolink_URL(
> > array(
> > "parameter" => 51,
> > "returnLast" => "url",
> > "useCacheHash" => "1",
> > )
> > );
> > return
> $this->sendToPage($this->toWebPath($sLink));
> > /*?>*/]]>
> > </php>
> > </userobj>
> > </onclick>
> > </renderlet:SUBMIT>
> >
> > I have 2 problems :
> > 1 - If the data are wrong, I can't see the error messages (from the
> > validators) because of the redirection.
> > 2 - I don't know how to add a message "User saved". I know how to make a
> > confirm message yes/no after the click but not just an information
> message
> > about the good insertion in the database.
> >
> > Can you help me ?
> >
> > Thanks in advance.
> >
> > Best regards.
> >
>
>
> --
>
> *Luc Muller*
> /Web Developper/
> /Formidable - Rapid Application Developpement Framework for Typo3
> <http://formidable.typo3.ug>/
> /Typo3 Ameos <http://www.ameos.com>/
>
> _______________________________________________
> TYPO3-project-formidable mailing list
> TYPO3-project-formidable at lists.netfielders.de
>
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-formidable
>
More information about the TYPO3-project-formidable
mailing list