开发者

flex tab navigator

I have a flex application mxml file with 3 tabs.the first tab having the link button to select the value in the 3rd tab.

Suppose, i have a link button in first atab. And the 3rd tab contains the combobox with values:"basic", "advanced". by default the vaule is displaying "default".

Wheni select the linkbutton on the first tab, the "advanced"should be displayed in the comboBox on the 3rd tab.

and the problem is , when click on the first tab link button , at that time the 3rd tab is not initialized.So it is not displaying the "advanced" in the comboBox. selecting the 2nd time on the link button it is 开发者_运维问答displaying fine. But not first time.

code: thirdTab.comboBoxId.selectedItem.data = 1;

Please help me out if need any changes


A tab is initialized when it is activated the first time, so your code should not work. You can separate data model and bind all the UI controls to the model.


Add an event listener to the 3rd tab that is handled by the parent of the TabNavigator. The handler for that event should be able to get the value from the first tab (which may be stored in the common parent) and return it to the 3rd tab so that the ComboBox there may be correctly set. Listen for the creationComplete event from the 3rd tab.


The dirty way is setting the creationPolicy property of your tab navigator to ContainerCreationPolicy.ALL. This will insure that all the tabs are initialized at once.

The right way is separating the model from the view and using binding as Yuras says.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜