[TYPO3-project-formidable] Fwd: formidable question

Tom Schneider schtom at gmail.com
Thu Dec 20 12:09:05 CET 2007


Hi tom,

Could you repost this question on the newslist typo3.project.formidable ?
I would like the answer to be public, as it would help others also :)

To answer, what I would do Is to use only one xml, with display-conditions
handled *inside*.


Example:

[plugin PHP]

$this->oForm = t3lib_div::makeInstance("tx_ameosformidable");
$this->oForm->init(
        $this,
        t3lib_extmgm::extPath($this->extKey) .
"xml/form+list-one-at-a-time.xml"
);

return $this->pi_wrapInBaseClass($this->oForm->render());

[/plugin PHP]

And the xml (also attached to this mail)

[XML]
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<formidable version="0.7.156"

xmlns:datahandler="http://www.ameos.com/formidable/0.7.156/datahandler"

xmlns:datasource="http://www.ameos.com/formidable/0.7.156/datasource"
        xmlns:renderer="http://www.ameos.com/formidable/0.7.156/renderer"
        xmlns:renderlet="http://www.ameos.com/formidable/0.7.156/renderlet"
        xmlns:validator="http://www.ameos.com/formidable/0.7.156/validator"
        xmlns:actionlet="http://www.ameos.com/formidable/0.7.156/actionlet">

        <meta>
                <name>form + list, one at a time</name>
                <form formid="myform"/>
                <debug>false</debug>
                <displaylabels>true</displaylabels>
        </meta>

        <control>
                <datahandler:DB>
                        <tablename>pages</tablename>
                        <keyname>uid</keyname>
                </datahandler:DB>

                <renderer:STANDARD/>

                <datasources>
                        <datasource:DB name="ds-pages">
                                <sql>SELECT * from pages</sql>
                        </datasource:DB>
                </datasources>

        </control>

        <elements>

                <renderlet:LISTER name="my-list">
                        <process>
                                <userobj>
                                        <php><![CDATA[/*<?*/

                                                return
!$this->oDataHandler->_edition();

                                        /*?>*/]]></php>
                                </userobj>
                        </process>
                        <datasource use="ds-pages" />
                        <columns>
                                <column type="renderlet:TEXT" name="title"
listHeader="Title" />
                                <column type="renderlet:DATE" name="tstamp"
listHeader="Modification"/>
                                <column type="renderlet:BUTTON"
name="btn-edit" listHeader="" label="Edit">
                                        <onclick runat="client">
                                                <userobj>
                                                        <php><![CDATA[/*<?*/

                                                                $aRow =
$this->oDataHandler->getListData();
                                                                return
$this->majixRequestEdition($aRow["uid"]);

                                                        /*?>*/]]></php>
                                                </userobj>
                                        </onclick>
                                </column>
                        </columns>
                </renderlet:LISTER>

                <renderlet:BOX name="edition-box">
                        <process>
                                <userobj>
                                        <php><![CDATA[/*<?*/

                                                return
$this->oDataHandler->_edition();

                                        /*?>*/]]></php>
                                </userobj>
                        </process>
                        <childs>
                                <renderlet:BOX mode="h2" html="Edit page" />
                                <renderlet:TEXT name="title" label="Title"
/>
                                <renderlet:SUBMIT name="btn-save"
label="Save" />
                                <renderlet:SUBMIT name="btn-close"
label="Close" mode="clear" />
                        </childs>
                </renderlet:BOX>

        </elements>

</formidable>
[/XML]


The condition wheter or not to display the list/edit form corresponds to
boolean $this->oDataHandler->_edition(); in /process
The conditions for list and form to display or not exclude themselves, so
that they're displayed one at a time.


Best regards,
Jerome Schneider

---------------------------- Message original ----------------------------
Objet:   This is the subject
De:      schtom at gmail.com
Date:    Lun 17 décembre 2007 11:18
À:       contact at ameos.com
--------------------------------------------------------------------------

NOM:  Tom Schneider
EMAIL:  schtom at gmail.com
TEL:
ADDRESS:  suisse
MESSAGE:
Dear Mr. Schneider

I'm in the process of writing an application with ameos formidable. It
seems to be a very good solution for my needs and I'm surprised how
flexible it actually is.

I'm stuck with one problem though: I have 2 xml files, one is the lister,
the other one the form. I need to have them displayed only one at a time
(done with if in php).

Everytime I enter a value to the form and press submit, the lister-xml is
shown. But the value does not get added to the database. It obviously does
only work as long as the form-xml is loaded a second time.

Is there a way to get the data from the form into the database without
having the form-xml displayed again? How can you do multi-page-forms?


I was trying to find the solution on the internet but was not having a lot
of success.

Thank you for your assistance, best regards

Tom Schneider

TV:  1

---------------------
Benoit CHAMBARD
43 Route de Brumath
67670 MOMMENHEIM
Tel : 03 88 59 18 70


More information about the TYPO3-project-formidable mailing list