Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue calling select function on spark.components.DropDownList #10

Open
mariangemarcano opened this issue Jun 29, 2011 · 1 comment
Open

Comments

@mariangemarcano
Copy link

getting the following error when calling the function function select(params:Object) using a label=newvalue

TypeError: Error #1034: Type Coercion failed: cannot convert org.flex_pilot.events::FPListEvent@15476fc9 to spark.events.IndexChangeEvent.

this occurs when the code is on this line
if (sel[labelField] != targetLabel) {
Events.triggerListEvent(obj, ListEvent.CHANGE);

on the function select(params:Object) (FPController.as)

complete stack

TypeError: Error #1034: Type Coercion failed: cannot convert org.flex_pilot.events::FPListEvent@15476fc9 to spark.events.IndexChangeEvent.
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at org.flex_pilot.events::Events$/triggerListEvent()[E:\Source\xx\Flex\xx\src\org\flex_pilot\events\Events.as:182]
at org.flex_pilot::FPController$/select()[E:\Source\xx\Flex\xx\src\org\flex_pilot\FPController.as:496]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at Function/()[E:\Source\xx\Flex\xx\src\org\flex_pilot\FlexPilot.as:138]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at flash.external::ExternalInterface$/_callIn()
at Function/()

any idea on how to select an item using this element?

@mariangemarcano
Copy link
Author

I just commented the called to the event as shown below and it is working on my end (it is changing the selectedItem to the new value without throwing any error), not sure what will be the proper fix for this.

      if(labelField in sel){
        if (sel[labelField] != targetLabel) {
        // Events.triggerListEvent(obj, ListEvent.CHANGE);
          for each (item in obj.dataProvider) {
            if (item[labelField] == targetLabel) { 
              obj.selectedItem = item;
            }
          }
        }
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant