在 DropDownList FLEX 中设置 SelectedItem

发布于 2024-12-03 16:27:39 字数 363 浏览 1 评论 0原文

我正在制作一些简单的项目,但我对 selectedItem 有问题。 我有这样的东西

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

,所以当我进入这种状态时,我从数据库中获取品牌并将它们填充到下拉列表中。

但我还有按钮,并且在单击事件时我正在更改此表单的状态,并且我想从下拉列表中选择特定品牌,但我不能。我不确定我是否做错了,或者问题是我在下拉列表填充之前选择了项目。

前任 品牌列表由奥迪和宝马组成,当我单击按钮时,我想打开此状态表单,其中存在此​​下拉列表,并具有选定的值(例如宝马)。

如何使这成为最简单的方法?

I am making some simple project and I have 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 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白鸥掠海 2024-12-10 16:27:39

据我了解,首先,当单击按钮并选择“表单”状态时,您应该检查是否有填充下拉项的数据,以免每次进入此状态时都有两个人拨打电话。
接下来是使用下拉列表组件的 selectedIndexselectedItem 属性。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文