[TYPO3-core] RFC: "type" fields for flexforms

Dmitry Dulepov dima at spamcop.net
Sat Mar 4 10:40:07 CET 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Though it is a patch request, I decided to write e-mail in free format
and explain it better because change is in sensitive place.

I want to propose a change to flexforms that allow to add "type"-style
fields to it. Change in "type" field will cause form to reload.
Behaviour is the same as for "Type" filed (CType) for tt_content table.
Change is minimal, two lines in TCEforms. I verified it in my environment.

Why and where it is useful? Extension author may design flexform with
various fields and use <displayCond> to control display of fields
depending on a value of another field ("type" field). When "type" field
changes, some other fields should appear and some other should be
hidden. It is not possible automatically right now. with my patch it
becomes possible. Extension configuration becomes much more flexible.

How it works? If developer wants to make a "type" field, he make the
following XML (fragment shown):

========================
<T3DataStructure>
  <meta>
    <langDisable>1</langDisable>
  </meta>
	<ROOT>
		<type>array</type>
		<el>
			<mode>
				<TCEforms>
					<label>LLL:EXT:myext/pi1/locallang.php:flexform.mode</label>
				        <onChange>reload</onChange>
					<config>
========================

<onChange>reload</onChange> tells TCEforms to watch for changes in this
field and reload form.

Why I am decided to use <onChange>? <type> would not be good here
because it is already used for other purposes. <onChange> allows to
provide other logic (validation, for example) in the future. For now
TCEforms checks for "reload" value only, anything else is ignored. I
admit that "onChange" may be not the best tag. Thus I am open to better
suggestions.

As I wrote, I tested this in my environment, it works and it really
useful for complex extensions (I already felt the difference).
Hopefully, this patch will not be rejected.

Patch is attached. Let me know what do you think.

Dmitry.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFECWB3RVcYnKJ8N6kRAmiGAJsFbJCn6/F/rgML6Km0yW/STv5lggCfUSQI
s40Dkop8OU/KQBvT1HZv6xQ=
=Ezz+
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: flex_reload.txt
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060304/46a8274a/attachment.txt 


More information about the TYPO3-team-core mailing list