In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
How to parse the Flex application connection data implementation, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
Because Flex applications do not connect directly to a database, you need to use some type of service to support the use of data.
Flex application connection data
Remember, the most important thing about manipulating data in a Flex application is that the Flex application does not connect directly to a database. Therefore, Adobe?FlexBuilder2 does not provide a tool to connect data directly. You can manipulate and manage data by using MXML and ActionScript code.
There are several ways you can manipulate and manage data in Flex, most of which are beyond the scope of a brief introduction here (see later sections for more information). In any case, imagine a way to connect to external data, and subsequent examples will demonstrate connecting to data in the XML structure.
Data generation
Because Flex applications do not connect directly to a database, you need to use some type of service to support the use of data. In a subsequent example, you will use the HTTPService component to get data from a XML file generated by PHP.
The * * step to connect to the database is to generate the data that will be used in the Flex program. In the application with PHP, you will take the following steps:
1. Create a database (such as MySQL).
two。 Write a PHP script to connect to the MySQL database and generate data in XML format.
These steps are also suitable for data generated on other working platforms (such as ASP.NET, JSP, etc.).
Connect external data sources
For the XML format data generated by PHP, you can use the HTTPService component to request the data, like this:
...
The HTTPService component defines a request ID that you will use to control the URL that provides the data or the binding between the server and the data.
Binding of external data and data-driven control
By binding data to data-driven control (data-drivencontrol), you can handle HTTPService
The result (XML data), like this:
The syntax of the data binding is shown in the dataProvider attribute of the data control (in wavy parentheses), which contains the data structure of the HTTPService request ID, the lastResult method, and the XML file. In this example, the data structure of the XML data source looks like this:
MobilePhone $199 CarCharger $34.
By setting the dataField property, the project data (name and price) is used as data for each column in the data grid.
Load data at run time
You can also load data when the Flex program starts running and, as shown later, send a request to a particular URL in HTTPService:
When you add the creationComplete method to the application tag, the data is loaded at run time and handed over to data-driven control (in this case, the data grid).
You can also add a HTTPService request to a control event instead of a tag in the program, as shown below:
Flex provides many ways to connect, manage, format, and validate data. You can manipulate and manage data by using remote program calls, data services, or other enterprise-level technologies.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.