Hi,

Question, why do you have a Panel inside a canvas inside a popup?

I could probably answer your question if you showed some pseudo code.

Which component is not sizing? The canvas? that holds all of the controls?

Is the popup a canvas or panel?

Somwhere a measurement is not getting updated, I'm sure you are aware. Since
I can't see what you are doing, try putting minWidth, minHeight = 0 in your
two sub components. This might override the component that is not
invalidating it's parent size.

That is the problem, a parent is saying, I haven't changed so don't update
my parent.

The reason you see addChild() and removeChild() working is because in the
framework it forces a total re measurement. And yes, this is not needed to
get the parent component to size correctly.

Peace, Mike



On 5/25/07, grantdotcox <[EMAIL PROTECTED]> wrote:

  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?




--
Teoti Graphix
http://www.teotigraphix.com

Blog - Flex2Components
http://www.flex2components.com

You can find more by solving the problem then by 'asking the question'.

Reply via email to