Adobe Dreamweaver Forums



Last 10 THreads :         Re: Colour differences on the web (Last Post : Ann_Shelbourne@adobeforums.com - Replies : 0 - Views : 1 )           »          cs4 full screen mode isn't saved in workspaces, unlike cs3 (Last Post : Ann_Shelbourne@adobeforums.com - Replies : 1 - Views : 2 )           »          help me with adjustments layers in CS4 (Last Post : eddie caruso - Replies : 5 - Views : 6 )           »          delete all channels previously created by "save selection" (Last Post : John_A_Horner@adobeforums.com - Replies : 2 - Views : 3 )           »          Just a small 3D project I have completed (Last Post : Ziggi - Replies : 0 - Views : 1 )           »          Change custom Vector class to new Vector class in player10 (Last Post : VarioPegged - Replies : 3 - Views : 4 )           »          CS4 Motion Editor issues (Last Post : aaronlyon - Replies : 2 - Views : 9 )           »          Looping through results with "Next" button (Last Post : Fetch - Replies : 1 - Views : 2 )           »          Writing a Dreamweaver Extension, where to start? (Last Post : Randy Edmunds - Replies : 1 - Views : 2 )           »          Focus, Browsers & Spry Accordion (Last Post : Randy Edmunds - Replies : 6 - Views : 7 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-04-2008, 09:02 AM
pbittner
 
Posts: n/a
Diggs:
Default Repeater performance

I'm currently working on a Flex project and need to show the content of a
dictionary (a xml file). After the creation of an Entry object for each entry
of my dictionary, the easiest way to display one entry is to use one Repeater
for the entry's attributes (each entry has got one or more attributes), one
Repeater for the attribute's items (each attribute has got items) and one
Repeater for the item's links (each item has got links). But as you can guess
it's not very efficient. I cannot harcode because my App must be able to
display any kind of dictionary which means different numbers of attributes,
items and links. Any idea ?




<mx:Repeater id="attributeRepeater"
dataProvider="{selectedEntry.getAttributesArray()} ">
<mx:HBox>
<mx:Label text="{attributeRepeater.currentItem.getName()}" width="80" />
<mx:VBox>
<mx:Repeater id="itemRepeater"
dataProvider="{attributeRepeater.currentItem.getIt emsArray()}" >
<mx:HBox>
<mx:Text text="{itemRepeater.currentItem.getName()}" width="400"/>
<mx:Repeater id="linkRepeater"
dataProvider="{itemRepeater.currentItem.getLinksAr ray()}" >
<mx:LinkButton label="{linkRepeater.currentItem.getName()}"
click="linkButtonHandler(event)" />
</mx:Repeater>
</mx:HBox>
</mx:Repeater>
</mx:VBox>
</mx:HBox>
</mx:Repeater>



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-04-2008, 09:02 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Repeater performance


"pbittner" <webforumsuser@macromedia.com> wrote in message
news:ge77no$cso$1@forums.macromedia.com...
> I'm currently working on a Flex project and need to show the content of a
> dictionary (a xml file). After the creation of an Entry object for each
> entry
> of my dictionary, the easiest way to display one entry is to use one
> Repeater
> for the entry's attributes (each entry has got one or more attributes),
> one
> Repeater for the attribute's items (each attribute has got items) and one
> Repeater for the item's links (each item has got links). But as you can
> guess
> it's not very efficient. I cannot harcode because my App must be able to
> display any kind of dictionary which means different numbers of
> attributes,
> items and links. Any idea ?


If you can pare it down to use Canvases or even UIComponents instead of
HBoxes and VBoxes, that will help performance a lot. Also, you might want
to look at setting the recycleChildren property to true.

HTH;

Amy


Reply With Quote
  #3 (permalink)  
Old 11-04-2008, 09:02 AM
pbittner
 
Posts: n/a
Diggs:
Default Re: Repeater performance

How can I use Canvases instead of Vbox and Hbox when I don't know how many
children my Canvas gonna have ?

And concerning the recycleChildren property, I've tried but the result is
completely wrong. I think that I cannot use it as each object repeated in the
repeater is different (it can have different children itself and not always the
same number of children).


Reply With Quote


  #4 (permalink)  
Old 11-04-2008, 09:02 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Repeater performance


"pbittner" <webforumsuser@macromedia.com> wrote in message
news:ge7dfc$kq5$1@forums.macromedia.com...
> How can I use Canvases instead of Vbox and Hbox when I don't know how many
> children my Canvas gonna have ?


Use an expression in the x and y field of the component that's being
repeated to lay it out properly.

> And concerning the recycleChildren property, I've tried but the result is
> completely wrong. I think that I cannot use it as each object repeated in
> the
> repeater is different (it can have different children itself and not
> always the
> same number of children).


You need to use invalidation to make sure that each object can refresh
itself when it's reused, similar to what you have to do when you make an
itemRenderer for a List based component.

HTH;

Amy


Reply With Quote
  #5 (permalink)  
Old 11-04-2008, 09:02 AM
_funkyboy
 
Posts: n/a
Diggs:
Default Re: Repeater performance

[q]Originally posted by: pbittner
I have tried to remove completely the Hbox and Vbox I'm using but it's not
quicker. The problem comes from the 3 Repeaters.

Concerning the recycleChildren property, I've tried but the result is
completely wrong. I think that I cannot use it as each object repeated in the
repeater is different (it can have different children itself and not always the
same number of children).
[/q]

Looks a complex scenario. You might want to consider Actionscript, which
enables much more control over instantiation, deletion and recycle.

Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 12:41 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk