Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-09-2011, 07:06 PM   #1
whitefinger
Registered User
 
Join Date: Jul 2011
Posts: 14
Default updating the dataProvider Repeated-Item-Data-List

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.

ScrollingContent.mxml
Has my buttons and the code to move through the total object

DataListSkin.mxml
contains the connection to the database, dataprovider and the itemRenderer

RepeatedItemskin.mxml
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

ScrollingContent.mxml
Code:
protected function button_clickHandler(event:MouseEvent):void
{
DataListSkin2.startIndex = RateClientDataListSkin2.startIndex + 9;
getItems_pagedResult.token = customerService.getItems_paged(RateClientDataListSkin2.startIndex, RateClientDataListSkin2.numItems);
}
DataListSkin.mxml
Code:
<s:DataGroup id="dataGroup" d:userLabel="Repeated Item" x="0" y="0" width="128" height="549"
 clipAndEnableScrolling="true"
				 creationComplete="dataGroup_creationCompleteHandler(event)"
				 dataProvider="{getItems_pagedResult.lastResult}"
				 itemRenderer="components.RepeatedItemSkin"
				 width.normal="526" height.normal="736">
RepeatedItemskin.mxml
Code:
<s:RichText d:userLabel="Name" x="46" y="6" color="#f9fcf8" fontFamily="Myriad Pro"
fontSize="13" kerning="off" lineHeight="120%" text="{data.lname}"
whiteSpaceCollapse="preserve">
</s:RichText>
<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>
<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>
<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>
<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">
</s:RichText>
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

Last edited by whitefinger; 08-09-2011 at 07:21 PM.
whitefinger is offline   Reply With Quote
Old 08-09-2011, 07:39 PM   #2
whitefinger
Registered User
 
Join Date: Jul 2011
Posts: 14
Default

Ok so i just found this on the net

Quote:
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!!!!
whitefinger is offline   Reply With Quote
Old 08-09-2011, 11:00 PM   #3
whitefinger
Registered User
 
Join Date: Jul 2011
Posts: 14
Default

you would think this would be my answer if im on the right tracks

Code:
dataGroup.dataProvider.refresh();
but its not
whitefinger is offline   Reply With Quote
Old 08-10-2011, 10:11 AM   #4
whitefinger
Registered User
 
Join Date: Jul 2011
Posts: 14
Default

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
whitefinger is offline   Reply With Quote
Old 08-10-2011, 01:22 PM   #5
whitefinger
Registered User
 
Join Date: Jul 2011
Posts: 14
Default

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
whitefinger is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:59 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.