[TYPO3-dev] Antw: sorting IRRE in FlexForm

Uwe Trotzek Trotzek at citeq.de
Fri Feb 15 08:00:07 CET 2013


Hi Sascha,

i don't think you can use the foreign_sortby option for your frontend controller. It is used to sort the available items section in the backend-flexform. If you want to provide an additional field to the user to manually change the sorting direction, you have to add something like this:

<mysorting>
	<TCEforms>
	<label>My sorting field</label>
	<config>
		<type>select</type>
		<items type="array">
			<numIndex index="0" type="array">
				<numIndex index="0">ascending</numIndex>
				<numIndex index="1">ascending</numIndex>
			</numIndex>
			<numIndex index="1" type="array">
				<numIndex index="0">descending</numIndex>
				<numIndex index="1">descending</numIndex>
			</numIndex>
		</items>
		<allowNonIdValues>1</allowNonIdValues>
	</config>
	</TCEforms>
</mysorting>

you can use the selected value easily in your controller by using $this->settings['flexform']['mysorting']

kind regards
Uwe

>>> Sascha <lsascha at gmail.com> 14.02.2013 16:58 >>>
Hello Everyone.

I hope someone can help me with my (small?) problem.

i currently have a Extbase model that can added multiple times into a FlexForm.
I do this with the following FlexForm part.

<!-- ... -->
<images>
	<TCEforms>
		<label>images</label>
		<config type="array">
			<type>inline</type>
			<foreign_table>tx_extension_domain_model_images</foreign_table>
			<foreign_sortby>sorting</foreign_sortby>
			<maxitems>9999</maxitems>
			<appearance type="array">
				<collapseAll>1</collapseAll>
				<showSynchronizationLink>1</showSynchronizationLink>
				<showPossibleLocalizationRecords>1</showPossibleLocalizationRecords>
				<showAllLocalizationLink>1</showAllLocalizationLink>
				<enabledControls type="array">
                    <info>0</info>
                    <new>1</new>
                    <dragdrop>1</dragdrop>
                    <sort>1</sort>
                    <hide>1</hide>
                    <delete>1</delete>
                    <localize>1</localize>
                </enabledControls>
				<levelLinksPosition>both</levelLinksPosition>
			</appearance>
		</config>
	</TCEforms>
</images>
<!-- ... -->


So far everything works without any problem.
But the sorting i make in the FlexForm is not saved in the database.
Maybe it ignores the definiton of <foreign_sortby>

I noticed that it saves the sorting in an XML inside the tt_content database-table.
It looks like this:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3FlexForms>
    <data>
        <sheet index="settings">
            <language index="lDEF">
                <field index="images">
                    <value index="vDEF">20,21</value>
                </field>
            </language>
        </sheet>
    </data>
</T3FlexForms>


And inside the <value index="vDEF"> are the two IDs of the Objects i added. And when i change the sorting it changes in the XML too. But not in the "sorting" field in the database.


That way i can not read the sorting when i use Extbase.
How can i solve this?


Many thanks in advance.
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev at lists.typo3.org 
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev




More information about the TYPO3-dev mailing list