event order issues

View: New views
5 Messages — Rating Filter:   Alert me  

event order issues

by Darrin Kay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Good Morning to all,
  I have a Cairngorm flex app, and I call a function to add something to the
db, and then after the insert is complete I pull the updated data, and I run
a sort.  Here is where my problem is, the sort works fine when it is called
after a click event by the user, but when I make the call after the insert
the filter is not applied.

here is the code wireframe:

on the insert button I added an
button.addEventListener(FlexEvent.UPDATE_COMPLETE, setlist); // not sure if
this is right

I have a as3 function that calls the dispatch event to do the insert all is
good.

the call happens and the sort is run, but I think this is being done before
the insert and list re-build is done, so is my eventListener right?


Thanks,
 Darrin

RE: event order issues

by Alex Harui :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Put trace statements in event handlers so you can see the order.  There's probably a collectionEvent after the insert that is better than UPDATE_COMPLETE which gets called often.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@... [mailto:flexcoders@...] On Behalf Of Darrin Kay
Sent: Sunday, November 01, 2009 11:07 PM
To: flexcoders@...
Subject: [flexcoders] event order issues



Good Morning to all,
  I have a Cairngorm flex app, and I call a function to add something to the db, and then after the insert is complete I pull the updated data, and I run a sort.  Here is where my problem is, the sort works fine when it is called after a click event by the user, but when I make the call after the insert the filter is not applied.

here is the code wireframe:

on the insert button I added an button.addEventListener(FlexEvent.UPDATE_COMPLETE, setlist); // not sure if this is right

I have a as3 function that calls the dispatch event to do the insert all is good.

the call happens and the sort is run, but I think this is being done before the insert and list re-build is done, so is my eventListener right?


Thanks,
 Darrin


Re: event order issues

by Darrin Kay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I put in the trace, and it is going to the sort before the result is back
from the db.  Any suggestions?

On Mon, Nov 2, 2009 at 7:42 AM, Alex Harui <aharui@...> wrote:

>
>
>  Put trace statements in event handlers so you can see the order.  There’s
> probably a collectionEvent after the insert that is better than
> UPDATE_COMPLETE which gets called often.
>
>
>
> Alex Harui
>
> Flex SDK Developer
>
> Adobe Systems Inc. <http://www.adobe.com/>
>
> Blog: http://blogs.adobe.com/aharui
>
>
>
> *From:* flexcoders@... [mailto:flexcoders@...] *On
> Behalf Of *Darrin Kay
> *Sent:* Sunday, November 01, 2009 11:07 PM
> *To:* flexcoders@...
> *Subject:* [flexcoders] event order issues
>
>
>
>
>
> Good Morning to all,
>   I have a Cairngorm flex app, and I call a function to add something to
> the db, and then after the insert is complete I pull the updated data, and I
> run a sort.  Here is where my problem is, the sort works fine when it is
> called after a click event by the user, but when I make the call after the
> insert the filter is not applied.
>
> here is the code wireframe:
>
> on the insert button I added an
> button.addEventListener(FlexEvent.UPDATE_COMPLETE, setlist); // not sure if
> this is right
>
> I have a as3 function that calls the dispatch event to do the insert all is
> good.
>
> the call happens and the sort is run, but I think this is being done before
> the insert and list re-build is done, so is my eventListener right?
>
>
> Thanks,
>  Darrin
>
>  
>

Re: event order issues

by Darrin Kay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

is there a way to dispatch the event from the command file?  that would
solve the problem

Thanks for the help,
 Darrin

On Mon, Nov 2, 2009 at 8:09 AM, Darrin Kay <darrin@...> wrote:

> I put in the trace, and it is going to the sort before the result is back
> from the db.  Any suggestions?
>
>
> On Mon, Nov 2, 2009 at 7:42 AM, Alex Harui <aharui@...> wrote:
>
>>
>>
>>  Put trace statements in event handlers so you can see the order.
>> There’s probably a collectionEvent after the insert that is better than
>> UPDATE_COMPLETE which gets called often.
>>
>>
>>
>> Alex Harui
>>
>> Flex SDK Developer
>>
>> Adobe Systems Inc. <http://www.adobe.com/>
>>
>> Blog: http://blogs.adobe.com/aharui
>>
>>
>>
>> *From:* flexcoders@... [mailto:flexcoders@...] *On
>> Behalf Of *Darrin Kay
>> *Sent:* Sunday, November 01, 2009 11:07 PM
>> *To:* flexcoders@...
>> *Subject:* [flexcoders] event order issues
>>
>>
>>
>>
>>
>> Good Morning to all,
>>   I have a Cairngorm flex app, and I call a function to add something to
>> the db, and then after the insert is complete I pull the updated data, and I
>> run a sort.  Here is where my problem is, the sort works fine when it is
>> called after a click event by the user, but when I make the call after the
>> insert the filter is not applied.
>>
>> here is the code wireframe:
>>
>> on the insert button I added an
>> button.addEventListener(FlexEvent.UPDATE_COMPLETE, setlist); // not sure if
>> this is right
>>
>> I have a as3 function that calls the dispatch event to do the insert all
>> is good.
>>
>> the call happens and the sort is run, but I think this is being done
>> before the insert and list re-build is done, so is my eventListener right?
>>
>>
>> Thanks,
>>  Darrin
>>
>>  
>>
>
>

RE: event order issues

by Alex Harui :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There should be an event when the result comes back from the db.  You can re-synch then.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@... [mailto:flexcoders@...] On Behalf Of Darrin Kay
Sent: Monday, November 02, 2009 12:16 AM
To: flexcoders@...
Subject: Re: [flexcoders] event order issues



is there a way to dispatch the event from the command file?  that would solve the problem

Thanks for the help,
 Darrin
On Mon, Nov 2, 2009 at 8:09 AM, Darrin Kay <darrin@...<mailto:darrin@...>> wrote:
I put in the trace, and it is going to the sort before the result is back from the db.  Any suggestions?

On Mon, Nov 2, 2009 at 7:42 AM, Alex Harui <aharui@...<mailto:aharui@...>> wrote:

Put trace statements in event handlers so you can see the order.  There's probably a collectionEvent after the insert that is better than UPDATE_COMPLETE which gets called often.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@...<mailto:flexcoders@...> [mailto:flexcoders@...<mailto:flexcoders@...>] On Behalf Of Darrin Kay
Sent: Sunday, November 01, 2009 11:07 PM
To: flexcoders@...<mailto:flexcoders@...>
Subject: [flexcoders] event order issues



Good Morning to all,
  I have a Cairngorm flex app, and I call a function to add something to the db, and then after the insert is complete I pull the updated data, and I run a sort.  Here is where my problem is, the sort works fine when it is called after a click event by the user, but when I make the call after the insert the filter is not applied.

here is the code wireframe:

on the insert button I added an button.addEventListener(FlexEvent.UPDATE_COMPLETE, setlist); // not sure if this is right

I have a as3 function that calls the dispatch event to do the insert all is good.

the call happens and the sort is run, but I think this is being done before the insert and list re-build is done, so is my eventListener right?


Thanks,
 Darrin