flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Ent <p...@adobe.com>
Subject Re: [FlexJS, MDL] Null Pointer Exception in HorizontalFlexLayout
Date Mon, 01 May 2017 13:41:59 GMT
Hi Piotr,

I mostly understand. It seems like the child is not UIBase so it is null,
at least in one of the cases. The layout code should be changed to check
for null and skip that child.  Can you see if that helps?


On 5/1/17, 8:35 AM, "piotrz" <piotrzarzycki21@gmail.com> wrote:

>Hi Peter,
>During creation of DropDownList component in MDL I have experienced Null
>Pointer Exception in HorizontalFlexLayout. [1]
>My DropDownList contains 3 elements: Div with selected text, Material icon
>(i) and Menu.
>Case 1: If I create DropDownList in MXML - MDL library handle properly
>Menu is a simple ul, but once upgrade is done MDL library surround it by
>additional div [2] "mdl-menu__container".
>HorizontalFlexLayout is going through the children of View in function
>"layout". Array contains 3 elements from my DropDownList - the last one is
>menu - in moment of layout perform it contains "ul" not
>This "ul" has been created by FlexJS and has element.flexjs_wrapper. and
>function getElementAt returns child one by one.
>Case 2 - ISSUE:
>I would like to create DropDownList dynamically:
>var dropDown:DropDownList = new DropDownList();
>In order to do this Menu inside DropDownList need to be "upgraded"
>- I need to tell MDL library that I've created Menu component - I have
>for that purpose which doing his job: UpgradeElement.
>Upgrade is completed successfully and MDL is surrounding "ul" by
>Now HorizontalFlexLayout is doing "layout" and trying to go through the
>children. In array for some reason there is no "ul" MDL Menu, but this
>"mdl-menu__container" which wasn't created by FlexJS. In that case it
>doesn't have element.flexjs_wrapper, so getElementAt returns null. And we
>are getting NPE.
>It look like everything what HorizontalFlexLayout is doing in Case 1
>happened before upgrading - in case 2 I'm doing upgrade during whole life
>cycle performance.
>I hope this long explanation help you understand issue and provide some
>feedback. I'm attaching simple project where you can reproduce this issue
>Apache Flex PMC
>View this message in context:
>Sent from the Apache Flex Development mailing list archive at Nabble.com.

View raw message