简体   繁体   中英

Eskimo's pia ComboBox component throws exception when calling .selectedItem()

I'm working on a Flex mobile application targeting both iOS and Android. I'm currently using Eskimo library for different controls, one of them is the I've been using for a long time across different versions of AIR.

However, I've upgraded my project to run the latest AIR 4.0 so I can go along with the latest news from Apple (you can find a thread talking about that here )

And since then, everytime I'm trying to retrieve the selected item, as following:

if (registeredUsersCombo.selectedItem)
{
    // Do something
}

I'm getting the following exception (I don't have access to the lines specified in the two first sentences):

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at com.pialabs.eskimo.components::UniqueChoiceList/get selectedItem()[/Users/fred/Projets/eskimo/piaMobileLib/src/main/flex/com/pialabs/eskimo/components/UniqueChoiceList.as:66]

at com.pialabs.eskimo.components::ComboBox/get selectedItem()[/Users/fred/Projets/eskimo/piaMobileLib/src/main/flex/com/pialabs/eskimo/components/ComboBox.as:158]

at aproove.presentation::InvitationPopUp/checkInvitedUserInformation()[C:\\Users\\XXXX\\Adobe Flash Builder 4.7\\XXXXXXX\\src\\XXXX\\presentation\\InvitationPopUp.mxml:168]

Did anyone encountered the same issue? Maybe I could work it around using .getSelectedLabelDisplay() which is still working, but it's really not the cleanest solution in my opinion.

EDIT : I've noticed something interesting. The issue is occurring when I try to get the selectedItem directly from the component ID, as in the following:

myCombo.selectedItem // Exception thrown

However, if the same ComboBox is reached through an event handler, the selectedItem() is working fine !

event.currentTarget.selectedItem; // event.currentTarget being the ComboBox, this is working

我认为该组件在您调用registeredUsersCombo.selectedItem之前并不完全初始化,请显示更多代码

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM