PDA

View Full Version : [OPEN] [UNKNOWN][3.x/2.x] Unable to reset Record with new Object property



arcsight-gui
16 Sep 2009, 3:58 PM
Hi,

This may have been fixed after version 2.1, but since I am limited to using that version at the moment, I'd like to know if this is really a bug or if there's something I'm doing wrong.


I create a new record with Record.create(), providing the field spec as required.
The first time I set a property called "def" to an empty object it works.
Later I try to reset this property with another object (different contents), and the record is not updated.


Following the debugger into the Ext JS code I can see why.

Even though the Ext JS documentation for 2.1 says that you can set a property on the record to an object (type), the code inside the set function decides to return if the String representation of the currently set value for that property is equal to the String representation of the one you're trying to reset it with.

Of course, for generic objects like {} the two representations are the same ("[object Object]") so the function returns without doing what you asked it to.

Is this a bug in the Ext JS code or is there something I don't understand here about the way the Record class or its set function is supposed to work?

Thanks very much.

Paul Sumares

mystix
16 Sep 2009, 6:15 PM
this related bug report should help:
http://www.extjs.com/forum/showthread.php?p=381985#post381985

p.s. this bug affects both the 2.x and 3.x branches. the 3.x branch does an Ext.encode() if the record field contains an Object, but as mentioned in another thread, two identical objects with different attribute orderings give different hashes when Ext.encode() is called on them.

mjlecomte
19 Sep 2009, 5:18 AM
Bug reports are addressed more easily / quickly if you post in accordance with this thread:
http://www.extjs.com/forum/showthread.php?t=71015

arcsight-gui
21 Sep 2009, 8:50 AM
mjlecompte,

Thanks for the advice, but that would be an appropriate next step once it has been established that this is indeed a bug. According to the sticky post here, http://www.extjs.com/forum/showthread.php?t=13985, one should only file bugs in the manner you describe.

The first line of my post clearly states: "This may have been fixed after version 2.1, but since I am limited to using that version at the moment, I'd like to know if this is really a bug or if there's something I'm doing wrong."

So far the discussion that mystix pointed me to does not contain an indication that the issue is being considered a bug because the suggestions (at least to me) appear clearly to be developer overrides of the default behavior as a way to get what I want to work.

So your advice is appreciated, but it is premature.

Paul

mjlecomte
21 Sep 2009, 6:25 PM
The bug forum is for reporting bugs.

If you don't know if you have a bug or not you are supposed to post to the help forum.

You are not providing enough information for me to even help. The protocol for posting bug reports is also an excellent way to request help, it describes the manner to post something complete which could be analyzed by someone else.

Seems to me if you have premium membership you have access to svn. Which would then mean that you have access to ext 2.2, 2.3, 3.0, 3.0.2, etc. So if you wanted to check if your code works with another version, you have that option.