You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by vi...@after24.net on 2017/08/26 16:23:47 UTC

Re: AIR

Bonjour,

En congés jusqu'au 4 septembre, je prendrais connaissance de votre message à mon retour.

Cordialement,

Vincent/AFTER24




Re: AIR

Posted by Kyle McKnight <ka...@gmail.com>.
Or you can also just make sure to set it as the data provider after the
results are received rather than before.

Kyle


Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight <ka...@gmail.com> wrote:

> Don't set _myResults to a brand new ArrayCollection.
>
> 1. Instead, insure _myResults exists (maybe create an empty one when you
> instantiate your DataManager).
> 2. Set _myResults as  the data provider on your DataGrid.
> 3. When you get your results, use the addItem method on _myResults to add
> the items.
>
> Kyle
>
>
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 <(602)%20515-1444> (M)
>
> 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
>
>> Bonjour,
>>
>> En congés jusqu'au 4 septembre, je prendrais connaissance de votre
>> message à mon retour.
>>
>> Cordialement,
>>
>> Vincent/AFTER24
>>
>>
>>
>>
>

Re: AIR

Posted by Kyle McKnight <ka...@gmail.com>.
No problem.

Also if you use this 2nd way, when the results are returned you'd have to
make sure to call the removeAll method to rest the collection before adding
more items to it.

If you prefer binding, Another way would be to bind the getter to an event
and dispatch that event when the results are received. Then use the getter
in you data grid using curly bracket bindkng. Then when the even is fired
the getter would get triggered  and the data grid would be updated

On Aug 26, 2017 6:42 PM, "Kyle McKnight" <ka...@gmail.com> wrote:

> Or just declare and define your _myresults variable at the same time.
>
> var _myResults:ArrayCollection = new ArrayCollection();
>
> Then instead of creating a new ArrayCollection when the results are
> returned, just run through the list of results in a loop and use the
> addItem method of the _myResults ArrayCollection to add each item to it
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 <(602)%20515-1444> (M)
>
> On Sat, Aug 26, 2017 at 6:40 PM, Kyle McKnight <ka...@gmail.com> wrote:
>
>> There are many ways you could do it.
>>
>> Try dispatching a custom event, something like "itemCategoriesRecieved,"
>> from the data manager when the results are returned. In your class that
>> contains the data grid, listen for that event on your data manager and set
>> the data provider of the grid in the event handler.
>>
>>
>> Kyle McKnight
>> Senior UI Engineer - Accesso
>> 602.515.1444 <(602)%20515-1444> (M)
>>
>> On Sat, Aug 26, 2017 at 6:34 PM, Trevor Holman <tr...@mchsi.com> wrote:
>>
>>> This is what I'm trying to do but I'm not sure how to do this so  that
>>> the variable is set before I set the dataProvider...
>>>
>>> -----Original Message-----
>>> From: Kyle McKnight [mailto:kamcknig@gmail.com]
>>> Sent: Saturday, August 26, 2017 11:38 AM
>>> To: Flex Users Group
>>> Subject: Re: AIR
>>>
>>> Or you can also just make sure to set it as the data provider after the
>>> results are received rather than before.
>>>
>>> Kyle
>>>
>>>
>>> Kyle McKnight
>>> Senior UI Engineer - Accesso
>>> 602.515.1444 (M)
>>>
>>> On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight <ka...@gmail.com>
>>> wrote:
>>>
>>> > Don't set _myResults to a brand new ArrayCollection.
>>> >
>>> > 1. Instead, insure _myResults exists (maybe create an empty one when
>>> > you instantiate your DataManager).
>>> > 2. Set _myResults as  the data provider on your DataGrid.
>>> > 3. When you get your results, use the addItem method on _myResults to
>>> > add the items.
>>> >
>>> > Kyle
>>> >
>>> >
>>> >
>>> >
>>> > Kyle McKnight
>>> > Senior UI Engineer - Accesso
>>> > 602.515.1444 <(602)%20515-1444> (M)
>>> >
>>> > 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
>>> >
>>> >> Bonjour,
>>> >>
>>> >> En congés jusqu'au 4 septembre, je prendrais connaissance de votre
>>> >> message à mon retour.
>>> >>
>>> >> Cordialement,
>>> >>
>>> >> Vincent/AFTER24
>>> >>
>>> >>
>>> >>
>>> >>
>>> >
>>>
>>>
>>
>

Re: AIR

Posted by Kyle McKnight <ka...@gmail.com>.
Or just declare and define your _myresults variable at the same time.

var _myResults:ArrayCollection = new ArrayCollection();

Then instead of creating a new ArrayCollection when the results are
returned, just run through the list of results in a loop and use the
addItem method of the _myResults ArrayCollection to add each item to it


Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Sat, Aug 26, 2017 at 6:40 PM, Kyle McKnight <ka...@gmail.com> wrote:

> There are many ways you could do it.
>
> Try dispatching a custom event, something like "itemCategoriesRecieved,"
> from the data manager when the results are returned. In your class that
> contains the data grid, listen for that event on your data manager and set
> the data provider of the grid in the event handler.
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 <(602)%20515-1444> (M)
>
> On Sat, Aug 26, 2017 at 6:34 PM, Trevor Holman <tr...@mchsi.com> wrote:
>
>> This is what I'm trying to do but I'm not sure how to do this so  that
>> the variable is set before I set the dataProvider...
>>
>> -----Original Message-----
>> From: Kyle McKnight [mailto:kamcknig@gmail.com]
>> Sent: Saturday, August 26, 2017 11:38 AM
>> To: Flex Users Group
>> Subject: Re: AIR
>>
>> Or you can also just make sure to set it as the data provider after the
>> results are received rather than before.
>>
>> Kyle
>>
>>
>> Kyle McKnight
>> Senior UI Engineer - Accesso
>> 602.515.1444 (M)
>>
>> On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight <ka...@gmail.com>
>> wrote:
>>
>> > Don't set _myResults to a brand new ArrayCollection.
>> >
>> > 1. Instead, insure _myResults exists (maybe create an empty one when
>> > you instantiate your DataManager).
>> > 2. Set _myResults as  the data provider on your DataGrid.
>> > 3. When you get your results, use the addItem method on _myResults to
>> > add the items.
>> >
>> > Kyle
>> >
>> >
>> >
>> >
>> > Kyle McKnight
>> > Senior UI Engineer - Accesso
>> > 602.515.1444 <(602)%20515-1444> (M)
>> >
>> > 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
>> >
>> >> Bonjour,
>> >>
>> >> En congés jusqu'au 4 septembre, je prendrais connaissance de votre
>> >> message à mon retour.
>> >>
>> >> Cordialement,
>> >>
>> >> Vincent/AFTER24
>> >>
>> >>
>> >>
>> >>
>> >
>>
>>
>

Re: AIR

Posted by Kyle McKnight <ka...@gmail.com>.
private var _myResults:ArrayCollection = new ArrayCollection();

private function resultsHandler(results:Object):void
{
    _myResults.removeAll();

    for(loop through results) {
        _myResults.addItem(result);
    }
}

You would then only need to set the data provider one time in your other
class, don't need to set it every single time the drop down changes.


Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Sat, Aug 26, 2017 at 7:24 PM, Kyle McKnight <ka...@gmail.com> wrote:

> From the limited code you've posted what looks like is happeing is that
> you are setting the data provider before you've created the ArrayColleciton
> so you are setting it to null. Then in the results handler you are creating
> a *new* ArrayCollection instead of editing the one that you set as the
> data provider (not that you could edit it anyway since it's null). This is
> why you aren't getting the results. Then when you change the drop down, you
> are once again setting the data provider, but this time you are setting it
> to the ArrayCollection you previously created and then yet again creating a
> NEW one instead of editing the one that's in the data provider.
>
> In the data manager, declare your _myResults like this
>
> private var _myResults:ArrayCollection = new ArrayCollection();
>
> Then instead of creating a new one using the new operator, loop through
> the results that come back and use addItem on _myResults. (also making sure
> to call removeAll before doing so each time)
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 <(602)%20515-1444> (M)
>
> On Sat, Aug 26, 2017 at 7:20 PM, Trevor Holman <tr...@mchsi.com> wrote:
>
>> I've tried this in the resultHandler function and when I trace that
>> variable _myResults I can see the [object Object], [object Object], [object
>> Object] ArrayCollection... so it is pulling in the right info, I just can't
>> figure out how to  get that to my Application.mxml. I've tried setting a
>> property and then using a getter (from my original post) but like I
>> mentioned it just pulls in the last change the dropdown displayed.
>>
>>  I know it's got to be something simple but I'm not even sure what to ask
>> and it eludes me. I'm pretty green when it comes to this and I want to
>> learn it. I can normally find what I need via google.
>>
>> -----Original Message-----
>> From: Kyle McKnight [mailto:kamcknig@gmail.com]
>> Sent: Saturday, August 26, 2017 5:43 PM
>> To: Flex Users Group
>> Subject: Re: AIR
>>
>> Or just declare and define your _myresults variable at the same time.
>>
>> var _myResults:ArrayCollection = new ArrayCollection();
>>
>> Then instead of creating a new ArrayCollection when the results are
>> returned, just run through the list of results in a loop and use the
>> addItem method of the _myResults ArrayCollection to add each item to it
>>
>>
>> Kyle McKnight
>> Senior UI Engineer - Accesso
>> 602.515.1444 (M)
>>
>> On Sat, Aug 26, 2017 at 6:40 PM, Kyle McKnight <ka...@gmail.com>
>> wrote:
>>
>> > There are many ways you could do it.
>> >
>> > Try dispatching a custom event, something like "itemCategoriesRecieved,"
>> > from the data manager when the results are returned. In your class
>> > that contains the data grid, listen for that event on your data
>> > manager and set the data provider of the grid in the event handler.
>> >
>> >
>> > Kyle McKnight
>> > Senior UI Engineer - Accesso
>> > 602.515.1444 <(602)%20515-1444> (M)
>> >
>> > On Sat, Aug 26, 2017 at 6:34 PM, Trevor Holman <tr...@mchsi.com>
>> wrote:
>> >
>> >> This is what I'm trying to do but I'm not sure how to do this so
>> >> that the variable is set before I set the dataProvider...
>> >>
>> >> -----Original Message-----
>> >> From: Kyle McKnight [mailto:kamcknig@gmail.com]
>> >> Sent: Saturday, August 26, 2017 11:38 AM
>> >> To: Flex Users Group
>> >> Subject: Re: AIR
>> >>
>> >> Or you can also just make sure to set it as the data provider after
>> >> the results are received rather than before.
>> >>
>> >> Kyle
>> >>
>> >>
>> >> Kyle McKnight
>> >> Senior UI Engineer - Accesso
>> >> 602.515.1444 (M)
>> >>
>> >> On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight <ka...@gmail.com>
>> >> wrote:
>> >>
>> >> > Don't set _myResults to a brand new ArrayCollection.
>> >> >
>> >> > 1. Instead, insure _myResults exists (maybe create an empty one
>> >> > when you instantiate your DataManager).
>> >> > 2. Set _myResults as  the data provider on your DataGrid.
>> >> > 3. When you get your results, use the addItem method on _myResults
>> >> > to add the items.
>> >> >
>> >> > Kyle
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > Kyle McKnight
>> >> > Senior UI Engineer - Accesso
>> >> > 602.515.1444 <(602)%20515-1444> (M)
>> >> >
>> >> > 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
>> >> >
>> >> >> Bonjour,
>> >> >>
>> >> >> En congés jusqu'au 4 septembre, je prendrais connaissance de votre
>> >> >> message à mon retour.
>> >> >>
>> >> >> Cordialement,
>> >> >>
>> >> >> Vincent/AFTER24
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >>
>> >>
>> >
>>
>>
>

RE: AIR

Posted by Kyle McKnight <ka...@gmail.com>.
Glad you got it working!

On Aug 26, 2017 10:34 PM, "Trevor Holman" <tr...@mchsi.com> wrote:

> Kyle, thank you... here's what I used to get it to work. Your code led me
> to some other reference on looping through the result array and I just used
> the private var as you mentioned.
>
>                 //handle result of getList function
>                 public function resultHandler(event:SQLEvent):void {
>                         var result:SQLResult = selectStmt.getResult();
>                         var temp:Array = result.data is Array ?
> result.data : [{rows:result.rowsAffected}];
>                         var listResult:ArrayCollection = new
> ArrayCollection(temp);
>                         _myResults.removeAll();
>                         _myResults.addAll(listResult);
>
>                 }
>
>
>
> -----Original Message-----
> From: Kyle McKnight [mailto:kamcknig@gmail.com]
> Sent: Saturday, August 26, 2017 6:29 PM
> To: Flex Users Group
> Subject: Re: AIR
>
> private var _myResults:ArrayCollection = new ArrayCollection();
>
> private function resultsHandler(results:Object):void
> {
>     _myResults.removeAll();
>
>     for(loop through results) {
>         _myResults.addItem(result);
>     }
> }
>
> You would then only need to set the data provider one time in your other
> class, don't need to set it every single time the drop down changes.
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 (M)
>
> On Sat, Aug 26, 2017 at 7:24 PM, Kyle McKnight <ka...@gmail.com> wrote:
>
> > From the limited code you've posted what looks like is happeing is
> > that you are setting the data provider before you've created the
> > ArrayColleciton so you are setting it to null. Then in the results
> > handler you are creating a *new* ArrayCollection instead of editing
> > the one that you set as the data provider (not that you could edit it
> > anyway since it's null). This is why you aren't getting the results.
> > Then when you change the drop down, you are once again setting the
> > data provider, but this time you are setting it to the ArrayCollection
> > you previously created and then yet again creating a NEW one instead of
> editing the one that's in the data provider.
> >
> > In the data manager, declare your _myResults like this
> >
> > private var _myResults:ArrayCollection = new ArrayCollection();
> >
> > Then instead of creating a new one using the new operator, loop
> > through the results that come back and use addItem on _myResults.
> > (also making sure to call removeAll before doing so each time)
> >
> >
> > Kyle McKnight
> > Senior UI Engineer - Accesso
> > 602.515.1444 <(602)%20515-1444> (M)
> >
> > On Sat, Aug 26, 2017 at 7:20 PM, Trevor Holman <tr...@mchsi.com>
> wrote:
> >
> >> I've tried this in the resultHandler function and when I trace that
> >> variable _myResults I can see the [object Object], [object Object],
> >> [object Object] ArrayCollection... so it is pulling in the right
> >> info, I just can't figure out how to  get that to my
> >> Application.mxml. I've tried setting a property and then using a
> >> getter (from my original post) but like I mentioned it just pulls in
> the last change the dropdown displayed.
> >>
> >>  I know it's got to be something simple but I'm not even sure what to
> >> ask and it eludes me. I'm pretty green when it comes to this and I
> >> want to learn it. I can normally find what I need via google.
> >>
> >> -----Original Message-----
> >> From: Kyle McKnight [mailto:kamcknig@gmail.com]
> >> Sent: Saturday, August 26, 2017 5:43 PM
> >> To: Flex Users Group
> >> Subject: Re: AIR
> >>
> >> Or just declare and define your _myresults variable at the same time.
> >>
> >> var _myResults:ArrayCollection = new ArrayCollection();
> >>
> >> Then instead of creating a new ArrayCollection when the results are
> >> returned, just run through the list of results in a loop and use the
> >> addItem method of the _myResults ArrayCollection to add each item to
> >> it
> >>
> >>
> >> Kyle McKnight
> >> Senior UI Engineer - Accesso
> >> 602.515.1444 (M)
> >>
> >> On Sat, Aug 26, 2017 at 6:40 PM, Kyle McKnight <ka...@gmail.com>
> >> wrote:
> >>
> >> > There are many ways you could do it.
> >> >
> >> > Try dispatching a custom event, something like
> "itemCategoriesRecieved,"
> >> > from the data manager when the results are returned. In your class
> >> > that contains the data grid, listen for that event on your data
> >> > manager and set the data provider of the grid in the event handler.
> >> >
> >> >
> >> > Kyle McKnight
> >> > Senior UI Engineer - Accesso
> >> > 602.515.1444 <(602)%20515-1444> (M)
> >> >
> >> > On Sat, Aug 26, 2017 at 6:34 PM, Trevor Holman <tr...@mchsi.com>
> >> wrote:
> >> >
> >> >> This is what I'm trying to do but I'm not sure how to do this so
> >> >> that the variable is set before I set the dataProvider...
> >> >>
> >> >> -----Original Message-----
> >> >> From: Kyle McKnight [mailto:kamcknig@gmail.com]
> >> >> Sent: Saturday, August 26, 2017 11:38 AM
> >> >> To: Flex Users Group
> >> >> Subject: Re: AIR
> >> >>
> >> >> Or you can also just make sure to set it as the data provider
> >> >> after the results are received rather than before.
> >> >>
> >> >> Kyle
> >> >>
> >> >>
> >> >> Kyle McKnight
> >> >> Senior UI Engineer - Accesso
> >> >> 602.515.1444 (M)
> >> >>
> >> >> On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight
> >> >> <ka...@gmail.com>
> >> >> wrote:
> >> >>
> >> >> > Don't set _myResults to a brand new ArrayCollection.
> >> >> >
> >> >> > 1. Instead, insure _myResults exists (maybe create an empty one
> >> >> > when you instantiate your DataManager).
> >> >> > 2. Set _myResults as  the data provider on your DataGrid.
> >> >> > 3. When you get your results, use the addItem method on
> >> >> > _myResults to add the items.
> >> >> >
> >> >> > Kyle
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > Kyle McKnight
> >> >> > Senior UI Engineer - Accesso
> >> >> > 602.515.1444 <(602)%20515-1444> (M)
> >> >> >
> >> >> > 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
> >> >> >
> >> >> >> Bonjour,
> >> >> >>
> >> >> >> En congés jusqu'au 4 septembre, je prendrais connaissance de
> >> >> >> votre message à mon retour.
> >> >> >>
> >> >> >> Cordialement,
> >> >> >>
> >> >> >> Vincent/AFTER24
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >
> >> >>
> >> >>
> >> >
> >>
> >>
> >
>
>

RE: AIR

Posted by Trevor Holman <tr...@mchsi.com>.
Kyle, thank you... here's what I used to get it to work. Your code led me to some other reference on looping through the result array and I just used the private var as you mentioned. 

		//handle result of getList function
		public function resultHandler(event:SQLEvent):void {
			var result:SQLResult = selectStmt.getResult();
			var temp:Array = result.data is Array ? result.data : [{rows:result.rowsAffected}];
			var listResult:ArrayCollection = new ArrayCollection(temp);
			_myResults.removeAll();
			_myResults.addAll(listResult);
			
		}



-----Original Message-----
From: Kyle McKnight [mailto:kamcknig@gmail.com] 
Sent: Saturday, August 26, 2017 6:29 PM
To: Flex Users Group
Subject: Re: AIR

private var _myResults:ArrayCollection = new ArrayCollection();

private function resultsHandler(results:Object):void
{
    _myResults.removeAll();

    for(loop through results) {
        _myResults.addItem(result);
    }
}

You would then only need to set the data provider one time in your other class, don't need to set it every single time the drop down changes.


Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Sat, Aug 26, 2017 at 7:24 PM, Kyle McKnight <ka...@gmail.com> wrote:

> From the limited code you've posted what looks like is happeing is 
> that you are setting the data provider before you've created the 
> ArrayColleciton so you are setting it to null. Then in the results 
> handler you are creating a *new* ArrayCollection instead of editing 
> the one that you set as the data provider (not that you could edit it 
> anyway since it's null). This is why you aren't getting the results. 
> Then when you change the drop down, you are once again setting the 
> data provider, but this time you are setting it to the ArrayCollection 
> you previously created and then yet again creating a NEW one instead of editing the one that's in the data provider.
>
> In the data manager, declare your _myResults like this
>
> private var _myResults:ArrayCollection = new ArrayCollection();
>
> Then instead of creating a new one using the new operator, loop 
> through the results that come back and use addItem on _myResults. 
> (also making sure to call removeAll before doing so each time)
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 <(602)%20515-1444> (M)
>
> On Sat, Aug 26, 2017 at 7:20 PM, Trevor Holman <tr...@mchsi.com> wrote:
>
>> I've tried this in the resultHandler function and when I trace that 
>> variable _myResults I can see the [object Object], [object Object], 
>> [object Object] ArrayCollection... so it is pulling in the right 
>> info, I just can't figure out how to  get that to my 
>> Application.mxml. I've tried setting a property and then using a 
>> getter (from my original post) but like I mentioned it just pulls in the last change the dropdown displayed.
>>
>>  I know it's got to be something simple but I'm not even sure what to 
>> ask and it eludes me. I'm pretty green when it comes to this and I 
>> want to learn it. I can normally find what I need via google.
>>
>> -----Original Message-----
>> From: Kyle McKnight [mailto:kamcknig@gmail.com]
>> Sent: Saturday, August 26, 2017 5:43 PM
>> To: Flex Users Group
>> Subject: Re: AIR
>>
>> Or just declare and define your _myresults variable at the same time.
>>
>> var _myResults:ArrayCollection = new ArrayCollection();
>>
>> Then instead of creating a new ArrayCollection when the results are 
>> returned, just run through the list of results in a loop and use the 
>> addItem method of the _myResults ArrayCollection to add each item to 
>> it
>>
>>
>> Kyle McKnight
>> Senior UI Engineer - Accesso
>> 602.515.1444 (M)
>>
>> On Sat, Aug 26, 2017 at 6:40 PM, Kyle McKnight <ka...@gmail.com>
>> wrote:
>>
>> > There are many ways you could do it.
>> >
>> > Try dispatching a custom event, something like "itemCategoriesRecieved,"
>> > from the data manager when the results are returned. In your class 
>> > that contains the data grid, listen for that event on your data 
>> > manager and set the data provider of the grid in the event handler.
>> >
>> >
>> > Kyle McKnight
>> > Senior UI Engineer - Accesso
>> > 602.515.1444 <(602)%20515-1444> (M)
>> >
>> > On Sat, Aug 26, 2017 at 6:34 PM, Trevor Holman <tr...@mchsi.com>
>> wrote:
>> >
>> >> This is what I'm trying to do but I'm not sure how to do this so 
>> >> that the variable is set before I set the dataProvider...
>> >>
>> >> -----Original Message-----
>> >> From: Kyle McKnight [mailto:kamcknig@gmail.com]
>> >> Sent: Saturday, August 26, 2017 11:38 AM
>> >> To: Flex Users Group
>> >> Subject: Re: AIR
>> >>
>> >> Or you can also just make sure to set it as the data provider 
>> >> after the results are received rather than before.
>> >>
>> >> Kyle
>> >>
>> >>
>> >> Kyle McKnight
>> >> Senior UI Engineer - Accesso
>> >> 602.515.1444 (M)
>> >>
>> >> On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight 
>> >> <ka...@gmail.com>
>> >> wrote:
>> >>
>> >> > Don't set _myResults to a brand new ArrayCollection.
>> >> >
>> >> > 1. Instead, insure _myResults exists (maybe create an empty one 
>> >> > when you instantiate your DataManager).
>> >> > 2. Set _myResults as  the data provider on your DataGrid.
>> >> > 3. When you get your results, use the addItem method on 
>> >> > _myResults to add the items.
>> >> >
>> >> > Kyle
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > Kyle McKnight
>> >> > Senior UI Engineer - Accesso
>> >> > 602.515.1444 <(602)%20515-1444> (M)
>> >> >
>> >> > 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
>> >> >
>> >> >> Bonjour,
>> >> >>
>> >> >> En congés jusqu'au 4 septembre, je prendrais connaissance de 
>> >> >> votre message à mon retour.
>> >> >>
>> >> >> Cordialement,
>> >> >>
>> >> >> Vincent/AFTER24
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >>
>> >>
>> >
>>
>>
>


Re: AIR

Posted by Kyle McKnight <ka...@gmail.com>.
From the limited code you've posted what looks like is happeing is that you
are setting the data provider before you've created the ArrayColleciton so
you are setting it to null. Then in the results handler you are creating a
*new* ArrayCollection instead of editing the one that you set as the data
provider (not that you could edit it anyway since it's null). This is why
you aren't getting the results. Then when you change the drop down, you are
once again setting the data provider, but this time you are setting it to
the ArrayCollection you previously created and then yet again creating a
NEW one instead of editing the one that's in the data provider.

In the data manager, declare your _myResults like this

private var _myResults:ArrayCollection = new ArrayCollection();

Then instead of creating a new one using the new operator, loop through the
results that come back and use addItem on _myResults. (also making sure to
call removeAll before doing so each time)


Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Sat, Aug 26, 2017 at 7:20 PM, Trevor Holman <tr...@mchsi.com> wrote:

> I've tried this in the resultHandler function and when I trace that
> variable _myResults I can see the [object Object], [object Object], [object
> Object] ArrayCollection... so it is pulling in the right info, I just can't
> figure out how to  get that to my Application.mxml. I've tried setting a
> property and then using a getter (from my original post) but like I
> mentioned it just pulls in the last change the dropdown displayed.
>
>  I know it's got to be something simple but I'm not even sure what to ask
> and it eludes me. I'm pretty green when it comes to this and I want to
> learn it. I can normally find what I need via google.
>
> -----Original Message-----
> From: Kyle McKnight [mailto:kamcknig@gmail.com]
> Sent: Saturday, August 26, 2017 5:43 PM
> To: Flex Users Group
> Subject: Re: AIR
>
> Or just declare and define your _myresults variable at the same time.
>
> var _myResults:ArrayCollection = new ArrayCollection();
>
> Then instead of creating a new ArrayCollection when the results are
> returned, just run through the list of results in a loop and use the
> addItem method of the _myResults ArrayCollection to add each item to it
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 (M)
>
> On Sat, Aug 26, 2017 at 6:40 PM, Kyle McKnight <ka...@gmail.com> wrote:
>
> > There are many ways you could do it.
> >
> > Try dispatching a custom event, something like "itemCategoriesRecieved,"
> > from the data manager when the results are returned. In your class
> > that contains the data grid, listen for that event on your data
> > manager and set the data provider of the grid in the event handler.
> >
> >
> > Kyle McKnight
> > Senior UI Engineer - Accesso
> > 602.515.1444 <(602)%20515-1444> (M)
> >
> > On Sat, Aug 26, 2017 at 6:34 PM, Trevor Holman <tr...@mchsi.com>
> wrote:
> >
> >> This is what I'm trying to do but I'm not sure how to do this so
> >> that the variable is set before I set the dataProvider...
> >>
> >> -----Original Message-----
> >> From: Kyle McKnight [mailto:kamcknig@gmail.com]
> >> Sent: Saturday, August 26, 2017 11:38 AM
> >> To: Flex Users Group
> >> Subject: Re: AIR
> >>
> >> Or you can also just make sure to set it as the data provider after
> >> the results are received rather than before.
> >>
> >> Kyle
> >>
> >>
> >> Kyle McKnight
> >> Senior UI Engineer - Accesso
> >> 602.515.1444 (M)
> >>
> >> On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight <ka...@gmail.com>
> >> wrote:
> >>
> >> > Don't set _myResults to a brand new ArrayCollection.
> >> >
> >> > 1. Instead, insure _myResults exists (maybe create an empty one
> >> > when you instantiate your DataManager).
> >> > 2. Set _myResults as  the data provider on your DataGrid.
> >> > 3. When you get your results, use the addItem method on _myResults
> >> > to add the items.
> >> >
> >> > Kyle
> >> >
> >> >
> >> >
> >> >
> >> > Kyle McKnight
> >> > Senior UI Engineer - Accesso
> >> > 602.515.1444 <(602)%20515-1444> (M)
> >> >
> >> > 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
> >> >
> >> >> Bonjour,
> >> >>
> >> >> En congés jusqu'au 4 septembre, je prendrais connaissance de votre
> >> >> message à mon retour.
> >> >>
> >> >> Cordialement,
> >> >>
> >> >> Vincent/AFTER24
> >> >>
> >> >>
> >> >>
> >> >>
> >> >
> >>
> >>
> >
>
>

RE: AIR

Posted by Trevor Holman <tr...@mchsi.com>.
That's what I think is happening too. I would like all the results from the Collection to come back and populate the DataGrid. Would I still need to addItem? I tried a version where I used push() but I think I was still creating a new ArrayCollection in the resultHandler... I will mess with it some more.

-----Original Message-----
From: Kyle McKnight [mailto:kamcknig@gmail.com] 
Sent: Saturday, August 26, 2017 6:24 PM
To: Flex Users Group
Subject: Re: AIR

From the limited code you've posted what looks like is happeing is that you are setting the data provider before you've created the ArrayColleciton so you are setting it to null. Then in the results handler you are creating a
*new* ArrayCollection instead of editing the one that you set as the data provider (not that you could edit it anyway since it's null). This is why you aren't getting the results. Then when you change the drop down, you are once again setting the data provider, but this time you are setting it to the ArrayCollection you previously created and then yet again creating a NEW one instead of editing the one that's in the data provider.

In the data manager, declare your _myResults like this

private var _myResults:ArrayCollection = new ArrayCollection();

Then instead of creating a new one using the new operator, loop through the results that come back and use addItem on _myResults. (also making sure to call removeAll before doing so each time)


Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Sat, Aug 26, 2017 at 7:20 PM, Trevor Holman <tr...@mchsi.com> wrote:

> I've tried this in the resultHandler function and when I trace that 
> variable _myResults I can see the [object Object], [object Object], 
> [object Object] ArrayCollection... so it is pulling in the right info, 
> I just can't figure out how to  get that to my Application.mxml. I've 
> tried setting a property and then using a getter (from my original 
> post) but like I mentioned it just pulls in the last change the dropdown displayed.
>
>  I know it's got to be something simple but I'm not even sure what to 
> ask and it eludes me. I'm pretty green when it comes to this and I 
> want to learn it. I can normally find what I need via google.
>
> -----Original Message-----
> From: Kyle McKnight [mailto:kamcknig@gmail.com]
> Sent: Saturday, August 26, 2017 5:43 PM
> To: Flex Users Group
> Subject: Re: AIR
>
> Or just declare and define your _myresults variable at the same time.
>
> var _myResults:ArrayCollection = new ArrayCollection();
>
> Then instead of creating a new ArrayCollection when the results are 
> returned, just run through the list of results in a loop and use the 
> addItem method of the _myResults ArrayCollection to add each item to 
> it
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 (M)
>
> On Sat, Aug 26, 2017 at 6:40 PM, Kyle McKnight <ka...@gmail.com> wrote:
>
> > There are many ways you could do it.
> >
> > Try dispatching a custom event, something like "itemCategoriesRecieved,"
> > from the data manager when the results are returned. In your class 
> > that contains the data grid, listen for that event on your data 
> > manager and set the data provider of the grid in the event handler.
> >
> >
> > Kyle McKnight
> > Senior UI Engineer - Accesso
> > 602.515.1444 <(602)%20515-1444> (M)
> >
> > On Sat, Aug 26, 2017 at 6:34 PM, Trevor Holman <tr...@mchsi.com>
> wrote:
> >
> >> This is what I'm trying to do but I'm not sure how to do this so 
> >> that the variable is set before I set the dataProvider...
> >>
> >> -----Original Message-----
> >> From: Kyle McKnight [mailto:kamcknig@gmail.com]
> >> Sent: Saturday, August 26, 2017 11:38 AM
> >> To: Flex Users Group
> >> Subject: Re: AIR
> >>
> >> Or you can also just make sure to set it as the data provider after 
> >> the results are received rather than before.
> >>
> >> Kyle
> >>
> >>
> >> Kyle McKnight
> >> Senior UI Engineer - Accesso
> >> 602.515.1444 (M)
> >>
> >> On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight 
> >> <ka...@gmail.com>
> >> wrote:
> >>
> >> > Don't set _myResults to a brand new ArrayCollection.
> >> >
> >> > 1. Instead, insure _myResults exists (maybe create an empty one 
> >> > when you instantiate your DataManager).
> >> > 2. Set _myResults as  the data provider on your DataGrid.
> >> > 3. When you get your results, use the addItem method on 
> >> > _myResults to add the items.
> >> >
> >> > Kyle
> >> >
> >> >
> >> >
> >> >
> >> > Kyle McKnight
> >> > Senior UI Engineer - Accesso
> >> > 602.515.1444 <(602)%20515-1444> (M)
> >> >
> >> > 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
> >> >
> >> >> Bonjour,
> >> >>
> >> >> En congés jusqu'au 4 septembre, je prendrais connaissance de 
> >> >> votre message à mon retour.
> >> >>
> >> >> Cordialement,
> >> >>
> >> >> Vincent/AFTER24
> >> >>
> >> >>
> >> >>
> >> >>
> >> >
> >>
> >>
> >
>
>


RE: AIR

Posted by Trevor Holman <tr...@mchsi.com>.
I've tried this in the resultHandler function and when I trace that  variable _myResults I can see the [object Object], [object Object], [object Object] ArrayCollection... so it is pulling in the right info, I just can't figure out how to  get that to my Application.mxml. I've tried setting a property and then using a getter (from my original post) but like I mentioned it just pulls in the last change the dropdown displayed. 

 I know it's got to be something simple but I'm not even sure what to ask and it eludes me. I'm pretty green when it comes to this and I want to learn it. I can normally find what I need via google. 

-----Original Message-----
From: Kyle McKnight [mailto:kamcknig@gmail.com] 
Sent: Saturday, August 26, 2017 5:43 PM
To: Flex Users Group
Subject: Re: AIR

Or just declare and define your _myresults variable at the same time.

var _myResults:ArrayCollection = new ArrayCollection();

Then instead of creating a new ArrayCollection when the results are returned, just run through the list of results in a loop and use the addItem method of the _myResults ArrayCollection to add each item to it


Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Sat, Aug 26, 2017 at 6:40 PM, Kyle McKnight <ka...@gmail.com> wrote:

> There are many ways you could do it.
>
> Try dispatching a custom event, something like "itemCategoriesRecieved,"
> from the data manager when the results are returned. In your class 
> that contains the data grid, listen for that event on your data 
> manager and set the data provider of the grid in the event handler.
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 <(602)%20515-1444> (M)
>
> On Sat, Aug 26, 2017 at 6:34 PM, Trevor Holman <tr...@mchsi.com> wrote:
>
>> This is what I'm trying to do but I'm not sure how to do this so  
>> that the variable is set before I set the dataProvider...
>>
>> -----Original Message-----
>> From: Kyle McKnight [mailto:kamcknig@gmail.com]
>> Sent: Saturday, August 26, 2017 11:38 AM
>> To: Flex Users Group
>> Subject: Re: AIR
>>
>> Or you can also just make sure to set it as the data provider after 
>> the results are received rather than before.
>>
>> Kyle
>>
>>
>> Kyle McKnight
>> Senior UI Engineer - Accesso
>> 602.515.1444 (M)
>>
>> On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight <ka...@gmail.com>
>> wrote:
>>
>> > Don't set _myResults to a brand new ArrayCollection.
>> >
>> > 1. Instead, insure _myResults exists (maybe create an empty one 
>> > when you instantiate your DataManager).
>> > 2. Set _myResults as  the data provider on your DataGrid.
>> > 3. When you get your results, use the addItem method on _myResults 
>> > to add the items.
>> >
>> > Kyle
>> >
>> >
>> >
>> >
>> > Kyle McKnight
>> > Senior UI Engineer - Accesso
>> > 602.515.1444 <(602)%20515-1444> (M)
>> >
>> > 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
>> >
>> >> Bonjour,
>> >>
>> >> En congés jusqu'au 4 septembre, je prendrais connaissance de votre 
>> >> message à mon retour.
>> >>
>> >> Cordialement,
>> >>
>> >> Vincent/AFTER24
>> >>
>> >>
>> >>
>> >>
>> >
>>
>>
>


Re: AIR

Posted by Kyle McKnight <ka...@gmail.com>.
There are many ways you could do it.

Try dispatching a custom event, something like "itemCategoriesRecieved,"
from the data manager when the results are returned. In your class that
contains the data grid, listen for that event on your data manager and set
the data provider of the grid in the event handler.


Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Sat, Aug 26, 2017 at 6:34 PM, Trevor Holman <tr...@mchsi.com> wrote:

> This is what I'm trying to do but I'm not sure how to do this so  that the
> variable is set before I set the dataProvider...
>
> -----Original Message-----
> From: Kyle McKnight [mailto:kamcknig@gmail.com]
> Sent: Saturday, August 26, 2017 11:38 AM
> To: Flex Users Group
> Subject: Re: AIR
>
> Or you can also just make sure to set it as the data provider after the
> results are received rather than before.
>
> Kyle
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 (M)
>
> On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight <ka...@gmail.com>
> wrote:
>
> > Don't set _myResults to a brand new ArrayCollection.
> >
> > 1. Instead, insure _myResults exists (maybe create an empty one when
> > you instantiate your DataManager).
> > 2. Set _myResults as  the data provider on your DataGrid.
> > 3. When you get your results, use the addItem method on _myResults to
> > add the items.
> >
> > Kyle
> >
> >
> >
> >
> > Kyle McKnight
> > Senior UI Engineer - Accesso
> > 602.515.1444 <(602)%20515-1444> (M)
> >
> > 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
> >
> >> Bonjour,
> >>
> >> En congés jusqu'au 4 septembre, je prendrais connaissance de votre
> >> message à mon retour.
> >>
> >> Cordialement,
> >>
> >> Vincent/AFTER24
> >>
> >>
> >>
> >>
> >
>
>

RE: AIR

Posted by Trevor Holman <tr...@mchsi.com>.
Okay, I was thinking along those lines at one point but thought there might be a different -- read easier way, because of my limited knowledge.  ;-)

Awesome, thank you. I appreciate it.


-----Original Message-----
From: Kyle McKnight [mailto:kamcknig@gmail.com] 
Sent: Saturday, August 26, 2017 5:40 PM
To: Flex Users Group
Subject: Re: AIR

There are many ways you could do it.

Try dispatching a custom event, something like "itemCategoriesRecieved,"
from the data manager when the results are returned. In your class that contains the data grid, listen for that event on your data manager and set the data provider of the grid in the event handler.


Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Sat, Aug 26, 2017 at 6:34 PM, Trevor Holman <tr...@mchsi.com> wrote:

> This is what I'm trying to do but I'm not sure how to do this so  that 
> the variable is set before I set the dataProvider...
>
> -----Original Message-----
> From: Kyle McKnight [mailto:kamcknig@gmail.com]
> Sent: Saturday, August 26, 2017 11:38 AM
> To: Flex Users Group
> Subject: Re: AIR
>
> Or you can also just make sure to set it as the data provider after 
> the results are received rather than before.
>
> Kyle
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 (M)
>
> On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight <ka...@gmail.com>
> wrote:
>
> > Don't set _myResults to a brand new ArrayCollection.
> >
> > 1. Instead, insure _myResults exists (maybe create an empty one when 
> > you instantiate your DataManager).
> > 2. Set _myResults as  the data provider on your DataGrid.
> > 3. When you get your results, use the addItem method on _myResults 
> > to add the items.
> >
> > Kyle
> >
> >
> >
> >
> > Kyle McKnight
> > Senior UI Engineer - Accesso
> > 602.515.1444 <(602)%20515-1444> (M)
> >
> > 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
> >
> >> Bonjour,
> >>
> >> En congés jusqu'au 4 septembre, je prendrais connaissance de votre 
> >> message à mon retour.
> >>
> >> Cordialement,
> >>
> >> Vincent/AFTER24
> >>
> >>
> >>
> >>
> >
>
>


RE: AIR

Posted by Trevor Holman <tr...@mchsi.com>.
This is what I'm trying to do but I'm not sure how to do this so  that the variable is set before I set the dataProvider... 

-----Original Message-----
From: Kyle McKnight [mailto:kamcknig@gmail.com] 
Sent: Saturday, August 26, 2017 11:38 AM
To: Flex Users Group
Subject: Re: AIR

Or you can also just make sure to set it as the data provider after the results are received rather than before.

Kyle


Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

On Sat, Aug 26, 2017 at 12:35 PM, Kyle McKnight <ka...@gmail.com> wrote:

> Don't set _myResults to a brand new ArrayCollection.
>
> 1. Instead, insure _myResults exists (maybe create an empty one when 
> you instantiate your DataManager).
> 2. Set _myResults as  the data provider on your DataGrid.
> 3. When you get your results, use the addItem method on _myResults to 
> add the items.
>
> Kyle
>
>
>
>
> Kyle McKnight
> Senior UI Engineer - Accesso
> 602.515.1444 <(602)%20515-1444> (M)
>
> 2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:
>
>> Bonjour,
>>
>> En congés jusqu'au 4 septembre, je prendrais connaissance de votre 
>> message à mon retour.
>>
>> Cordialement,
>>
>> Vincent/AFTER24
>>
>>
>>
>>
>


Re: AIR

Posted by Kyle McKnight <ka...@gmail.com>.
Don't set _myResults to a brand new ArrayCollection.

1. Instead, insure _myResults exists (maybe create an empty one when you
instantiate your DataManager).
2. Set _myResults as  the data provider on your DataGrid.
3. When you get your results, use the addItem method on _myResults to add
the items.

Kyle




Kyle McKnight
Senior UI Engineer - Accesso
602.515.1444 (M)

2017-08-26 12:23 GMT-04:00 <vi...@after24.net>:

> Bonjour,
>
> En congés jusqu'au 4 septembre, je prendrais connaissance de votre message
> à mon retour.
>
> Cordialement,
>
> Vincent/AFTER24
>
>
>
>