1

I am looking for some advice in regards to getting a very quick display of our reports. The problem I am working with is I receive an XML data structure that defines our layout. The report can be anywhere from 2 to 3 pages to perhaps 20 to 30. So to make the report display as quickly as possible I would like to just render the visible portion of the report. Here are the issues I need to overcome to accomplish this and I am looking for some advice how how to accomplish this.

To get a better visualization, Think of this like a word document. The reports have sections and I want to be able to get them to display as quickly as possible.

1) Of course I do not know the height of the child components I will be adding. Is there any techniques where I can determine if the components I am adding are not include in the view port and could I trigger off scroll bar movement.

2) I was thinking of adding estimation to the children components and then using that to set the height of the parent container. then when I receive scroll bar move event, I would check if the child components have been added to the parent and if not add them. Is there anyway to get the height of a component without rendering it?

3) Does Flex support anything built in that will accomplish this.

Any other techniques would be welcome. Basically I want to get the report displayed to the user as quickly as possible and delay the rendering of components that are off the screen.

Any suggestions would be welcomed. Thanks in advance.

Added Info.
Hard to provide code since I have not coded it yet. Let me try and expand with some details. I have a Parent Container where I take the some XML and using the XML creating children components based on the information in the XML. Right now when we do this it can take a long time to render a long report. What I want to do is to reduce the rendering time by delaying the rendering of those children objects. I have looked into things like the creation policy and createDeferredContent, but not sure if this is the right way to go. Guess the general problem I need to attack is how to do you stop rendering objects once you are outside the parents viewport. What I want is an item renderer like functionality but there is no similarity between the children. Perhaps a picture might be useful (will add as soon as I get to 10 points)?

Picture showing what I am trying to explain

1 Answers1

0

Use spark List with useVirtualLayout turned on. This is what it does.

There is always similarity between children, but if you can't find it, you can use an itemRendererFunction.

Amy Blankenship
  • 6,485
  • 2
  • 22
  • 45
  • so this works if all the children are different type of componenets. Think of a report with different sections. One being a Grid with a section header and the other is a HGroup with a series of images. – WeeJavaDude Jun 27 '12 at 00:41
  • I will dig into this and feedback if I think it will fit what I am trying to accomplish. – WeeJavaDude Jun 27 '12 at 02:12
  • From taking a quick look this looks like the direction I think we need to go. Thanks for the pointer Amy. – WeeJavaDude Jun 29 '12 at 22:11
  • Have a quick followup question. Given the rows in the case would be nested components (Fairly complex), would them being item renderers be a concern? Been told that item renders should be light weight and these are definitely not light weight. This is a desktop app. – WeeJavaDude Jul 02 '12 at 16:33
  • If you have 500 of them on screen, yes, they should be lightweight. However, it sounds to me like you're planning on 2-3 or so on screen at a time. The extra overhead that you get from the fact they're being rendered as part of a List/ItemRenderer architecture is overhead you'd probably get if you wrote logic yourself that does the same thing. – Amy Blankenship Jul 02 '12 at 16:44