I recently used flex for my graduation project. Here I will record the problems encountered during the learning process and some experiences. This article is about the data transmitted by the ComboBox binding server.
The interaction between flex and. NET is weborb for. net. The data source on the server is dataset. After being passed to the client, it is converted into an array and bound to ComboBox.CodeThe client code is as follows (part of this article ):
1 [Bindable]
2 Private VaR classlist: array;
3 Function close (): void { Trace ("" + txtstudentclass. selecteditem. classid ); }
4 < MX: ComboBox ID = " Txtstudentclass " Prompt = " Select a class " Dataprovider = " {Classlist} " Labelfield = " Classname "Close =" close ()" />
Note: The class table contains two fields: classid and classname. The generated array naturally contains two parts. When the ComboBox component uses the attribute labelfield to bind the displayed field and obtains its corresponding ID, the selecteditem attribute is used, specifically studentclass. selecteditem. classid.