开发者

set SelectedItem in DropDownList FLEX

开发者 https://www.devze.com 2023-04-03 19:44 出处:网络
I am making some simple project and I h开发者_如何学JAVAave problem with selectedItem. I have sth like this

I am making some simple project and I h开发者_如何学JAVAave problem with selectedItem. I have sth like this

<s:State name="Form" enterState="makesService.send()"/>

so when I enter this state I take makes from database and populate them to dropdownlist.

but I have also button and on click event I'm changing state to this Form and I want to select specific make from the dropdownlist but I can't. I'm not sure whether I'm doing sth wrong or the problem is that I'm selecting item just before the dropdownlist became populated.

e.x. List of make consist of Audi and BMW and when I click button I want to open this state Form in which this dropdownlist exist with selected value e.x. BMW.

How to make this the easiest way ?


Well from what I understand, first of all, when clicking the button and selecting the "Form" state you ought to check whether or not you have data that populates the dropdown item, so as not two make the call each time you enter this state.
The next this is to use the selectedIndex or selectedItem property of the dropdown list component.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号