Skip to main content

Search and Top Navigation

#6186 closed bug (notabug)

Opened October 14, 2010 09:12PM UTC

Closed October 15, 2010 01:37PM UTC

Last modified October 11, 2012 09:15PM UTC

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:

Attachments (0)
Change History (4)

Changed October 15, 2010 01:37PM UTC by scottgonzalez comment:1

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.

Changed October 18, 2010 08:36PM UTC by epascarello comment:2

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

Changed October 18, 2010 08:39PM UTC by scottgonzalez comment:3

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

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:4

milestone: TBD

Milestone TBD deleted