I have resolved the error which was in fact nothing to do with Zend
Framework code.
It seems that outputting the subform in firebug so I could see it was
formed correctly was interfering with the Dojo form element view helper
in some way when it was creating the dijits.
All working now anyway, thanks for the help. My brain hurts now :(
Chris
Chris MacPherson wrote:
Matthew Weier O'Phinney wrote:
-- Chris MacPherson <[email protected]> wrote
(on Thursday, 12 February 2009, 02:42 PM +0000):
Matthew Weier O'Phinney wrote:
-- Chris MacPherson <[email protected]> wrote
(on Thursday, 12 February 2009, 12:32 PM +0000):
I am creating a Dojo form which contains a Dojo subform.
My main form looks like this:
...
$this->_form->setMethod('post')
->addElement(
'TextBox',
'report_item_title',
array(
'label' => 'Title',
'required' => true
)
)
->addElement(
'Textarea',
'report_item_description',
array(
'label' => 'Description',
'required' => false,
'style' => 'width: 300px;',
)
);
// Add in subform
if (key_exists('subform', $args)) {
$this->_form->addSubform($args['subform'], 'ItemSubForm');
}
...
and my subform looks like this:
...
$subForm = new Zend_Dojo_Form_SubForm('PieForm');
$subForm->addElement(
'FilteringSelect',
'data_column',
array(
'label' => 'Data column',
'Description' => 'Column in dataset to be used
for Pie
data',
'required' => true
)
);
...
There are no duplicated elements or ids here but when I run my code I
get the
following notice:
Notice: Duplicate dijit ID detected for id "data_column; temporarily
generating
uniqid" in
C:\xampp\php\include\Zend\Dojo\Form\Decorator\DijitElement.php on
line 173
Has anyone had a similar experience or is this a bug?
Are you adding the same subform multiple times, with the same name? That
would cause the issue -- and trigger emission of that notice.
I've just double checked this with Firebug to make sure, The subform is only
being added once, . The element in question is only being added once also.
I don't see anything in here that would trigger that. Can you provide
the smallest amount of code that reproduces the issue for you (something
that does not rely on user input would be best)? I'll then see if I get
the same results, and if so, post an issue for it.
Yeah I'll try and sort something out.