This project contains simple Flex applications fed through a Lightstreamer connection based on Lightstreamer StockList Demo Adapter; the demos are written for Flex 4 SDK and one of the the two is ready for deployment as an Adobe AIR application.
This is a Flex version of the Stock-List Demos, where ten items are subscribed to.
This app uses the Flex Client API for Lightstreamer to handle the communications with Lightstreamer Server and uses the Flex DataGrid to display the real-time data pushed by Lightstreamer Server.
The upper table shows the automatic binding of a Lightstreamer data table to a Flex widget (a DataGrid). You can sort on any columns and drag the columns around. The buttons to the right control the update highlight effects and can stop/start the subscription.
The lower table shows the direct use of pushed values to manually update a Flex widget (a TextArea). The buttons to the right can clear the TextArea and stop/start the subscription.
Tables involved:
- A VisualTable containing 10 items, subscribed to in MERGE mode, bound to the Flex DataGrid.
- A NonVisualTable containing 10 items, subscribed to in MERGE mode, used to get the events to write into the Flex TextArea.
If you want to install a version of this demo pointing to your local Lightstreamer Server, follow these steps:
- Note that, as prerequisite, the Lightstreamer - Stock- List Demo - Java Adapter has to be deployed on your local Lightstreamer Server instance. Please check out that project and follow the installation instructions provided with it.
- Launch Lightstreamer Server.
- Download the
deploy.zip
file that you can find in the deploy release of this project and extract theFlex4_StockListDemo
folder. - Crate the folders
/pages/demos/[demo_name]
into your Lightstreamer server installation then copy here the contents of theFlex4_StockListDemo
folder. - Launch the demo.
To build your own version of Flex4StockListDemo.swf
, instead of using the one provided in the deploy.zip file from the Install section above, the Flex4_StockListDemo
folder of this project includes the following sub-folders:
-
/src
Contains the sources to build the Flex application. The code of demo is based on Flex 4 SDK. -
/lib
Should contain the Lightstreamer library, to be used for the build process.
Please Download the latestLightstreamer_as_client.swc
library file from the Lightstreamer Flex Client SDK resources into this folder of the project.
The Flex4_StockListDemo/deploy
folder contains a deployment image of the demo, which includes a container page and other web resources. You have to complete this with the built Flex application Flex4StockListDemo.swf
and the swfobject.js
version 2.2 file from SWFObject 2.
This deployment image is ready to be deployed under Lightstreamer's internal Web Server, by copying all the contents into the pages
directory.
By the current configuration, the demo tries to access Lightstreamer Server by using the protocol, hostname, and port from which the index.html
page was requested; in other words, the demo assumes that the static resources are deployed inside Lightstreamer Server.
To deploy the demo static resources on an external Web Server, some changes are needed on the deployment image before or after copying it into the Web Server folders.
The configuration of the hostname and port (and maybe the protocol) to be used to access Lightstreamer Server should be changed. The configuration lines can be easily found at the beginning of the index.html
file and can be modified manually, without the need for a recompilation.
Then, to allow the page to get resources from a different server, the Web Server address has to be included in the /crossdomain.xml
file deployed under Lightstreamer Server.
See the <flex_crossdomain_enabled> element in the Server configuration file for details.
Anyway, the QUOTE_ADAPTER has to be deployed in your local Lightstreamer server instance;
the LiteralBasedProvider is also needed, but it is already provided by Lightstreamer server.
The demos are now ready to be launched.
This is the AIR version of the Flex Demo.
If you want to install a version of this demo pointing to your local Lightstreamer Server, follow these steps:
- Note that, as prerequisite, the Lightstreamer - Stock- List Demo - Java Adapter has to be deployed on your local Lightstreamer Server instance. Please check out that project and follow the installation instructions provided with it.
- Launch Lightstreamer Server.
- Download the
deploy.zip
file that you can find in the deploy release of this project and extract the theAir4_StockListDemo
folder. - Launch the
LightstreamerAIRDemoFlex4.air
AIR application, the Adobe AIR runtime is required.
To build your own version of LightstreamerAIRDemoFlex4.air
, instead of using the one provided in the deploy.zip file from the Install section above, the "AIR4_StockListDemo" folder of this project includes the following sub-folders:
-
/src
Contains the sources to build the AIR application. The code is based on Flex 4 SDK. -
/lib
Should contain the Lightstreamer library, to be used for the build process.
Please Download the latestLightstreamer_as_client.swc
library file from the Lightstreamer Flex Client SDK resources into this folder of the project.
To install and run the AIR application, the Adobe AIR runtime is required.
By the current configuration, specified in AIR4StockListDemo.mxml
and used in the provided AIR package, the demo tries to connect to the demo server currently running on Lightstreamer website.
The demo can be reconfigured and recompiled to connect to the local installation of Lightstreamer Server. The host name, the port number, the Adapter Set names, and the Data Adapter names should all be changed in the source code.
- Lightstreamer - Stock- List Demo - Java Adapter
- Lightstreamer - Reusable Metadata Adapters- Java Adapter
- Lightstreamer - Stock-List Demos - HTML Clients
- Lightstreamer - Basic Stock-List Demo - jQuery (jqGrid) Client
- Lightstreamer - Stock-List Demo - Dojo Toolkit Client
- Lightstreamer - Basic Stock-List Demo - Java SE (Swing) Client
- Lightstreamer - Basic Stock-List Demo - .NET Client
- Lightstreamer - Stock-List Demos - Flash Clients
- Compatible with Lightstreamer Flex client API version 2.1 or newer.
- Ensure that Flex Client API is supported by Lightstreamer Server license configuration.