1 person found this helpful
What about registering a data change listener that calls invalidateSize() (which results in measure() being called)?
Given that you named the class TextDynamicLayout, it implies you are trying to handle wordwrapping text. That requires handing down the VBox's explicitWidth to the Text controls before they get measured. Wordwrapping text can be any size so it needs to have its width fixed in order to determine its height.
The List classes do not support percentages on the renderers. All renderers are effectively given a size based on the List's size (or DG Column size). You can see how explicitWidth is handled in the default renderer by looking at the source for ListItemRenderer.as.
Note that VBox or any container makes for heavy and slow rendering. That's why the default Flex renderers extend UIComponent and have custom measure() and updateDisplayList() methods.
Flex SDK Developer
Adobe Systems Inc.
I mistakenly chose "Answered." The question has not been answered completely, but I cannot undo that action of choosing "Answered."
Ben, I am not sure how that will solve the problem, could you eexplain a bit more, please?
Flex harUI, You explained the situation precisely as it is in my case. So, is there not a solution to the problem? I really need to vertically and horizontally center the VBox (with its content, and adjust the height and width of the VBox based on the text content).
Look at the image below, the VBox has the grey background and inside the VBox are dynamically rendered textFields with image bullets using the HBox . I know it is best to use the UIComponent for custom itemRenderers, but in my case, there is not really a list of items, just the one you see on Screen, only the text in the VBox changes when the dataProvider changes.
Any suggestions? Thanks.
Please see my previous post, I still need help with this issue.