Opened 12 years ago

Closed 12 years ago

#11337 closed defect (invalid)

ContentPane: setting AccordionContainer as contents causes duplicate ID

Reported by: Grimmy102 Owned by:
Priority: high Milestone: future
Component: Dijit Version: 1.4.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

I have a TabContainer, which is parent to a ContentPane. I attempt to set the "content" attr of that ContentPane with this line:

this.buddyTripsAccordion.attr("content", this.buddyTrips.domNode);

and I get this error in the firebug console:

Error parsing in _ContentSetter#Setter_dijit_layout_ContentPane_1_1 Error: Tried to register widget with id==tripListAccordion but that id is already registered { message="Tried to register widge...d is already registered",  more...}

The variable "buddyTrips" is an instance of a custom widget called "TripList," which contains the following AccordionContainer definition:

<div dojoType="dijit.layout.AccordionContainer" id="tripListAccordion" buttonWidget="rides.widget.TripListAccordionButton" class="tripListAccordion" dojoAttachPoint="accordionContainer" duration="200" >.  

I am certain that this widget is only added once. This error happens 4 lines after I programmatically create the TripList? widget, so there's no time for anything else to happen to this object. I can't figure out why this ID would be getting registered twice; I'm concluding it must be a bug.

In case it matters, here's the definition of my TabContainer/ContentPane (I'm adding the TripList to the "buddyStuffAccordion" one)

<div dojoType="dijit.layout.TabContainer" dojoAttachPoint="accordionContainer" useMenu="false" useSlider="false" class="leftHandSummary">
		<div dojoType="dijit.layout.ContentPane" dojoAttachPoint="invitesAccordion" title="Buddy Requests"> </div>
		<div dojoType="dijit.layout.ContentPane" dojoAttachPoint="buddyStuffAccordion" title="Buddy Stuff"> </div>

Change History (2)

comment:1 Changed 12 years ago by bill

Description: modified (diff)
Milestone: tbdfuture
Summary: Adding AccordionContainer as contents of ContentPane causes duplicate IDContentPane: setting AccordionContainer as contents causes duplicate ID

Thanks, please attach a test case using the Attach File button.

Try to narrow it down some... like does the TabContainer need to be involved? Does the problem only happen with your custom widget or anytime that you do attr("content", accordionContainer.domNode)?

Normally ContentPane calls the parser on it's new contents, but normally new contents are strings. I guess that when the new contents are dom nodes we shouldn't run the parser.

In any case you should be able to work around the problem by setting parseOnLoad: false for your ContentPane.

comment:2 Changed 12 years ago by bill

Resolution: invalid
Status: newclosed

Closing since no test case.

Note: See TracTickets for help on using tickets.