Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#6186 closed bug (notabug)

Objects being shared bewteen instances with the widget factory?

Reported by: epascarello Owned by:
Priority: major Milestone:
Component: ui.widget Version: 1.8.5
Keywords: Cc:
Blocked by: Blocking:


Today I discovered a bug in my widget and traced it to the widget code. It appears that my objects are being shared between different instances of the widget.

I update instance A and instance B will also get updated with the new data. When I update A, I do not expect B to also change.

Is this intended behavior with the widget factory? I do not remember it doing it in the previous major dot version.

I created example here:

Change History (4)

comment:1 Changed 12 years ago by Scott González

Resolution: invalid
Status: newclosed

Yes, this is intended behavior. We don't do anything to mask the prototypal inheritance other than creating separate option hashes for each instance.

comment:2 Changed 12 years ago by epascarello

Guess I am going to figure out a better way to maintain data that should be separate and not part of options. :)

comment:3 Changed 12 years ago by Scott González

You can define the data inline in _create(). If you need more help, feel free to ask for help on the forum.

comment:4 Changed 10 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.