I have created a custom multiline item renderer for mx:Tree component. Important to mention that my item renderer has two UITextFields in it. Sometimes (depends of the input data) only one of UITextFields must be shown, so when second UITextField is not needed I hide it and recalculate the height of my item renderer. According to my tests height is calculated properly.
The problem occures when I do scroll of my tree. The error text is:
TypeError: Error #1010: A term is undefined and has no properties.
at mx.controls::List/adjustVerticalScrollPositionDownward()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\List.as:1042]
at mx.controls::List/configureScrollBars()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\List.as:987]
at mx.controls.listClasses::ListBase/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:4394]
at mx.controls::List/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\List.as:1136]
at mx.controls::Tree/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\Tree.as:1203]
at mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:3962]
at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:663]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:736]
at mx.managers::LayoutManager/validateNow()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:795]
at spark.components::Application/resizeHandler()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\components\Application.as:1215]
at spark.components::Application/commitProperties()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\components\Application.as:938]
at mx.core::UIComponent/validateProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:7772]
at mx.managers::LayoutManager/validateProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:572]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:730]
at mx.managers::LayoutManager/validateNow()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:795]
at spark.components::Application/resizeHandler()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\components\Application.as:1215]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers::SystemManager/Stage_resizeHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2971]
I recalculate the height of each item using protected override function measure(). How to fix this?