2 Replies Latest reply on Jul 28, 2008 10:29 PM by jonesf

    How to force a container redraw to fit-to-content?

    jonesf Level 1
      Hi,
      This has been driving me crazy for a long time now.
      Example:
      <panel id="outer">
      <panel id="inner">
      <textarea text="blah blah blah"/>
      </panel>
      </panel>
      The above works fine, the outer panel's size perfectly fits its content.
      But if the mxml starts out with only the outer panel, and then I add the inner panel as result of some user event at a later time, then outer panel will not resize to fit. It will be really small and just add some scrollbars when the new content is added.
      I've tried several combinations of the following on the various elements with no luck...
      container.invalidateDisplayList();
      container.invalidateSize();
      container.validateDisplayList();
      container.validateNow();
      container.validateSize(true);
      Doing these things seem to have no effect. Arrgh.. please help!
      Thanks