One other thing to note;
When the event kind is update, the items property of the event contains a
mx.events.PropertyChangeEvent
reference,
When the reset happens the items property is an empty array.
Peace, Mike
On 12/11/06, Michael Schmalle <[EMAIL PROTECTED]> wrote:
Oh yeah,
When I have the Tree scrolled and select a checkbutton and toggle it;
This is a trace fromt he tree's collectionChangeHandler() override
''
collectionChangeHandler() update
collectionChangeHandler() update
collectionChangeHandler() update
collectionChangeHandler() update
collectionChangeHandler() reset
''
As you can see, right at the end a reset event.kind is comming through and
that is what is resetting the tree.
Peace, Mike
On 12/11/06, Michael Schmalle <[EMAIL PROTECTED]> wrote:
> Hi Deepa,
>
> I'm using the DefualtDataDescriptor as the super class but, I have a
> midified version of the setToggled() method.
>
> var field:String = tree.toggledField;
> if (node is XML ||
> node is XMLList)
> {
> try
> {
> if (field.search("@") != -1)
> {
> node[field] = value;
> }
> else
> {
> node["@" + field] = value;
> }
> //trace("NODE", [EMAIL PROTECTED], field)
> }
> catch (e:TypeError)
> {
> //trace(e)
> }
> }
>
> It's actually this line;
>
> node[field] = value;
>
> that goes to the XMLChangeWatcher.
>
> Once it is in the change watcher and update is called and then a reset
> is called.
>
> In the change watcher, it hits the attributeAdded.
>
> path;
>
> initializeXMLForNotification()
> IXMLNotifiable(notifiable).xmlNotification(currentTarget, ty, tar,
> value, detail);
>
> currentTarget : the node the descriptor changed
> ty attributeAdded
> tar node
> value toggled
> detail true
>
> xmlNotification()
> case 'attributeAdded'
> itemUpdated()
> itemUpdateHandler(event);
>
> listChangeHandler()
>
> You know, as I am writting this I am running the debugger. I can see the
> update everywhere. It goes on forever. Then I step throught to the end and
> it's the last thing that happens. I can't find it right now but, right at
> the end it resets the tree.
>
> It definitly is being spawned by this
>
> -> node[field] = value;
>
>
> Peace, Mike
>
>
>
> On 12/11/06, Deepa Subramaniam < [EMAIL PROTECTED]> wrote:
>
> > Hi Michael –
> >
> >
> >
> > Whenever an item is updated in the model, the Tree should receive an
> > UPDATE type of collectionChange event, not a RESET. Have/Can you narrow down
> > which call is causing the RESET to be emitted? My attempts to add an
> > attribute to a data item in the model via the descriptor or through the
> > model itself always produce an UPDATE type of collectionChange event.
> >
> >
> >
> > Incidentally, we use the setToggled() method in DefaultDataDescriptor
> > for menu-based controls. I'm assuming you're adding a similarly named
> > attribute to your Tree's model to indicate to the CheckBox whether it should
> > be selected or not?
> >
> >
> >
> > -deepa
> > ------------------------------
> >
> > *From:* [email protected] [mailto:[EMAIL PROTECTED]
> > * On Behalf Of *Michael Schmalle
> > *Sent:* Saturday, December 09, 2006 8:35 AM
> > *To:* [email protected]
> > *Subject:* [flexcomponents] XML :: Tree :: XMLChangeWatcher
> >
> >
> >
> > Hi,
> >
> > I have a little problem here.
> >
> > I have a check box tree that works fine most of the time. I have run
> > into a bug that I didn't have before.
> >
> > I have debugged it using the debugger and found the 'problem'. When
> > you assign an XML dataProvider, I use a dataDescriptor that sets an @toggled
> > attribute on the model.
> >
> > The problem is, the XMLChangeNotifier sends an attributeChanged event
> > and eventually down the line, the Tree gets a CollectionChange event that is
> > a 'reset' right at the end of a toggle on the check box.
> >
> > The problem is, if the Tree is scrolled, it resets the scroll position
> > to 0 every time becasue of the reset event.
> >
> > I have tried doing a hac blobk during toggle select but, it ends up
> > messing the view of the Tree.
> >
> > How can I fix this?
> >
> > Peace, Mike
> >
> > --
> > Teoti Graphix
> > http://www.teotigraphix.com
> >
> > Blog - Flex2Components
> > http://www.flex2components.com
> >
> > You can find more by solving the problem then by 'asking the
> > question'.
> >
> >
> >
>
>
>
> --
> Teoti Graphix
> http://www.teotigraphix.com
>
> Blog - Flex2Components
> http://www.flex2components.com
>
> You can find more by solving the problem then by 'asking the question'.
>
--
Teoti Graphix
http://www.teotigraphix.com
Blog - Flex2Components
http://www.flex2components.com
You can find more by solving the problem then by 'asking the question'.
--
Teoti Graphix
http://www.teotigraphix.com
Blog - Flex2Components
http://www.flex2components.com
You can find more by solving the problem then by 'asking the question'.