I have a matrix of flags that I put in the table. I need to stretch this matrix into several forms, and sometimes several times into one form, so I configured it as a subordinate.
After much research and discussion, I decided that the best way to decorate the subformation is to use the viewScript decoder. The code for adding a subform to the form looks something like this:
$this->addSubForm(new Test_Form_Connection_Config_Base(), 'user'); $this->user->setDecorators(array( array('viewScript', array('viewScript' => '_forms/userConfig.phtml')), 'Description', 'FieldSet', ));
For the most part, this works fine, but one problem I have is that I cannot get the array descriptor to work. Obviously, this becomes a problem when I include a matrix more than once in a specific form.
I tried using setIsArray (true), however this did not have an effefct effect. It seems that I need to run the FormElements decorator to get the array notation, but then it gives me a duplicate of the set of fields on the page (once FormElements is rendered and once using viewScript).
I could manually create the name of each element to reflect the array notation, but this seems like a long way. Are there any other options that I am missing?
Thanks...
source share