View Full Version : updating the dataProvider Repeated-Item-Data-List

08-09-2011, 07:06 PM
OK so i built my web site in Flash Catalyst and then imported it into Flash builder and for my first project in Flash builder i may of over complicated it a bit as i have about 60 components to work through!

The start of coding for my site was a little sticky at first as i had to turn all my php code into an object originated form, which in the Php world was new to me :)

Anyway for a part of my site i new pagination was needed and for the most part Flash builder wizard was resolving this for me, But it would appear that the wizard is best suited for a Data-Grid with a scroll bar and this was not the object that i wanted to use for my site.

Once i had worked out how the object originated php would be linked to my RepeatedItem-Data-List and was able to display 9 objects to the screen i then added the code to the next and back buttons in-order to move forward and backwards through the total object and if i looked at the the Network Monitor it would show me that the buttons were working and that the relevant data was being retrieved from the database.

But the web site doesn't refresh with the new objects on the screen, it just shows the original object from when the paged first loaded, now being new to all this i have search for about 5 days now and im thinking that perhaps im barking up the wrong tree to get my problem resolved hence im asking for your help in order for me to move on.

When i found this problem it was suggested that i updated my dataProvider or that it should of been updated automatically and I'm very thankful for the advise but after a lot of searching I'm still unable to resolve.

Has my buttons and the code to move through the total object

contains the connection to the database, dataprovider and the itemRenderer

Contains the objects {data.fields}

So now bare in mind that i just started with web programming on and off for about a year and perhaps only a month with flash builder and that perhaps its just a simple function that i may need to call from my button page so that i can communicate with the page "class" that holds the DataProvider and as these are all separate classes i cant access anything from each other classes other than static variables which I'm sure isn't true and is just my poor understanding.

I have tried writing functions and passing the php fetched data into an array but nothing is working for me yet and i might be looking in the wrong area!

Does anyone know what I'm talking about can anyone share some light? please


protected function button_clickHandler(event:MouseEvent):void
DataListSkin2.startIndex = RateClientDataListSkin2.startIndex + 9;
getItems_pagedResult.token = customerService.getItems_paged(RateClientDataListS kin2.startIndex, RateClientDataListSkin2.numItems);


<s:DataGroup id="dataGroup" d:userLabel="Repeated Item" x="0" y="0" width="128" height="549"
width.normal="526" height.normal="736">


<s:RichText d:userLabel="Name" x="46" y="6" color="#f9fcf8" fontFamily="Myriad Pro"
fontSize="13" kerning="off" lineHeight="120%" text="{data.lname}"
<s:RichText d:userLabel="Age" x="39" y="22" color="#f9fcf8" fontFamily="Myriad Pro" fontSize="13" kerning="off" lineHeight="120%" text="{data.yearofbirth}" whiteSpaceCollapse="preserve">
<s:RichText d:userLabel="Sex" x="37" y="40" color="#f9fcf8" fontFamily="Myriad Pro" fontSize="13" kerning="off" lineHeight="120%" text="{data.sex}" whiteSpaceCollapse="preserve">
<s:RichText d:userLabel="Country" x="61" y="58" color="#f9fcf8" fontFamily="Myriad Pro" fontSize="13" kerning="off" lineHeight="120%" text="{data.country}" whiteSpaceCollapse="preserve">
<s:RichText d:userLabel="Town" x="54" y="76" color="#f9fcf8" fontFamily="Myriad Pro" fontSize="13" kerning="off" lineHeight="120%" text="{data.town}" whiteSpaceCollapse="preserve">

any help or thoughts i would appreciate as currently stuck in doors in London whilst thugs out side burning London to the ground :( Helpful thoughts and the Army would really help right now :)

08-09-2011, 07:39 PM
Ok so i just found this on the net

I think you need to make a refresh on your dataprovider after changing. Something like :

(result.datagrid.dataProvider as ICollectionView).refresh();

Ok so im not using a data Grid so im hoping if i change this to maybe DataGroup this may work but i assume i will have to put this in my DataListSkin.mxml class because of the dataProvider, so how do i access this from the button class!!!!

08-09-2011, 11:00 PM
you would think this would be my answer if im on the right tracks


but its not :(

08-10-2011, 10:11 AM
I have tried adding to collections as arrays and other stuff that is on the net and hasn't work for me but the problem i have with this so far is if my web site has got this far without creating any arrays surly the true answer can be resolved quite easy with just some kind of refresh!!!

i am so stuck and going round and round in an endless loop anyone with any ideas? please

08-10-2011, 01:22 PM
Just as i was about to give up i felt if i couldn't work out the code then perhaps i should move my buttons within the same class as the dataprovider which might make things a little easier and before i started writing the code it all just worked lol

shame i didn't do that 5 days ago :( :)