I am creating a dijit form (pretty much) using examples found throughout the Zend site.... a zend form using dijit elements, but displayed as a table of text entry fields....

public function init() {

//
$this->setAction('/inquiry/')
->setMethod('post');

$this->setAttribs(array('name'=>'form'));

$this->setDecorators(array(
'Formelements',
array('HtmlTag',array('tag'=>'table')),
'DijitForm'
));


.... other elements, etc....


This form is being created in a layout script. All works well when I embed
this in a page using plain-old <divs>

But --- when I try to embed the form in a content pane wrapped by a
border container (that is, move my form to a page that includes a border container layout), the
dijit elements (javascript) is not kicking in --- I am getting a JS error:
as reported by Firebug:

>>>>>>>>>>>
Tried to register widget with id==topBorder but that id is already registered
[Break on this error] window[(typeof (djConfig)!="undefined"...config["defaultDuration"]||200;}}};});

<<<<<<<<<<<

The layout script looks like:

<?php
echo $this->headLink()->appendStylesheet('/css/myStyle.css');
if ($this->dojo()->isEnabled()) {
$this->dojo()->addStyleSheetModule('dijit.themes.tundra');
echo $this->dojo();
}
echo ($this->headScript()->appendFile('/js/myScript.js'));
?>
</head>
<body class='tundra'>

<div id="mainDiv">
<div id='topBorder' dojoType="dijit.layout.BorderContainer" style="width: 100%; height: 100%">
<div dojoType="dijit.layout.ContentPane" style='height:75px;' region="top">
Top pane
</div>

<div dojoType='dijit.layout.ContentPane' region='center'>
<div class='centerBox'>
<?php

// HERE's the problem form --- works OK if not wrapped by a
// content pane
//
echo $this->layout()->content;

?>
</div>

etc......

I have seen other posting warning against the creation of dijit elements
(programmatically) after the 'echo $this->dojo() ' (something to do with
the helper classes inserting JS code') but I haven't really been able
to find a clear explanation of what is going wrong.

Any help?