PDA

View Full Version : repeating groups of components?


glacts
08-23-2006, 10:42 PM
I'd like to lay out a group of components that are populated by an xml file and repeat them for each node group in that file.

So, for instance, if I have an xml file like the following:

<groups>
<group id="1"/>
<hardware name="hw1">
<software type="OS" name="Windows2000" vendor="Microsoft"/>
<software type="Spreadsheet" name="Excel" vendor="Microsoft"/>
</hardware>
<hardware name="hw2">
<software type="OS" name="WindowsXP" vendor="Microsoft"/>
<software type="Spreadsheet" name="Excel" vendor="Microsoft"/>
</hardware>
</group>
<group id="2"/>
<hardware name="hw1">
<software type="OS" name="Windows2000" vendor="Microsoft"/>
<software type="Spreadsheet" name="Excel" vendor="Microsoft"/>
</hardware>
<hardware name="hw2">
<software type="OS" name="WindowsXP" vendor="Microsoft"/>
<software type="Spreadsheet" name="Excel" vendor="Microsoft"/>
</hardware>
</group>
</groups>


And I want to display:


Name: Group 1

Hardware: hw1
(datagrid containing software)

Name: Group 2

Hardware: hw2
(datagrid containing software)

So, 'Name' and 'Hardware' are static labels, and 'Group 1' and 'Group 2' and the datagrids are dynamically populated from the xml file. A standard list or hbox/vbox combo won't seem to work because I'd like the positioning of the elements to be more precise (with indenting, etc).

I'd also like to contain all of these repeated components within a Canvas within a TabNavigator.

Any ideas?

Thanks in advance.

blockage
09-13-2006, 11:32 PM
Sounds like you need to write a custom ui container to me. hows your ActionScript?

http://www.adobe.com/devnet/flex/quickstart/building_components_in_as/

Tink
09-14-2006, 01:11 AM
A standard list or hbox/vbox combo won't seem to work because I'd like the positioning of the elements to be more precise (with indenting, etc).stick a Spacer in there

blockage
09-14-2006, 06:49 AM
stick a Spacer in there

Tink, Tink Tink, always with the shortcut - I'm beginning to think you don't share my joy for nice, long and completely unnecessary scripts.

Tink
09-14-2006, 08:45 AM
:)