
Well, dynaflex was developed for the commerce extensiion. The reason was, that it was not possible to change a flexform on load. That means that it wasn't possible to change a ones defined flexform structure depending on some environmental things. For example, create a different number of input fields, depending on the number of entries in a specific database table. Now, such things can be done with the dynaflex extension.
Basically, the dynaflex extension changes the content and / or structure of the TCA. The TCA is the central configuration array inside TYPO3. This makes it a little bit tricky, because there is no special place inside the workflow of the TYPO3 backend where the TCA is completely build up. That comes along with the method the TCA is build up. Every single extension brings their own addition for the TCA. Every time you call a backendform the TCA is parsed and the form is build up. I don't want to talk about all the internals of that. Last but not least, you as developer have to put the dynaflex call at that point in the TCA where your definition is placed. Normally that is directly after your definition of the TCA. (You can find some examples in the manual for dynaflex.)
But that's not how dynaflex works but when... ;-) So, how does it do the magic? You have to define a second configuration array (I call it DCA). This is loaded into the dynaflex class and parsed through it. With that configuration array you can define which field should be modified inside the TCA. And the most important part, you have to define HOW it is modified.
It's the nature of the things, that this modifications are performed on every call of the backend form. So it's possible to change flexforms very dynamic. :-)
OK, there are allways things to do. One big problem this time is, that the values of the flexforms are stored inside the database in a separated XML structure. That is not the problem itself. The problem is how this datastructures are handled. Because it was not planned that some of the field maybe disappear sometimes, the structure of the xml will never cleaned up. For example, if you insert some fields into a flexform, and if the user fills in some data everything is fine. But if of some reasons, one of the fields will be removed from the flexform, the values of the removed field will be remain in the structure. Obisiously this can cause some problems. I'm working on that to keep the value xml structure clean. :-)