I'm fairly new at Flex, and having some problems with getting
containers and components to automatically resize to fit their
contents - when these contents are a custom component (separate mxml
file).

I have a component ("GroupsList"), based on Canvas with a number of
containers inside (Panel, HBox, VBox etc).  These will be added /
removed based on what controls the user interacts with (using
addChild, removeChild).  None of the containers in this component have
widths or heights set, so they correctly just fit around whatever
content is showing.

Now, I have this whole "GroupsList" component inside another
component, "GroupsPopup".  This component displays the above component
and a few additional buttons and controls.  The containers in this
also have no widths or heights set.

When this GroupsPopup is first shown, it correctly sizes to fit the
displaying GroupsList content (plus the other buttons etc).  However,
as the GroupsList changes size due to interaction, the GroupsPopup
does not respond - making the GroupsList impossible to use.

I have made the inner component dispatch an event to call
invalidateSize(), invalidateDisplayList() etc, but this does not cause
a resize.  If the outer component has a addChild/removeChild call then
it does, but this seems highly inappropriate to use just for forcing a
resize.

Can anyone shed any light on this?

Reply via email to