For components that implement the jsx3.xml.Cacheable interface, such as Matrix and Menu, you can also specify whether to load XML data sources asynchronously or synchronously using the following properties:
- XML Async specifies whether an XML URL data source should be loaded synchronously or asynchronously. This property is used in conjunction with the XML URL property.
- If the property is set to Asynchronous, the data source is loaded asynchronously and a loading message displays until the data has finished loading.
- If this property is not set or is set to Synchronous, the data source is loaded synchronously as in General Interface 3.4 and earlier.
- XML Bind specifies whether a control is bound to its cached XML data. If set to Bound, the control repaints whenever the cached XML document changes.
To get and set these properties programmatically, see the jsx3.xml.Cacheable.getXmlAsync(), jsx3.xml.Cacheable.setXmlAsync(),jsx3.xml.Cacheable.getXmlBind(), and jsx3.xml.Cacheable.setXmlBind() in General Interface API Reference.
The BlockX component has an additional property:
- XSL Async specifies whether an XSL URL template should be loaded synchronously or asynchronously. This property is used in conjunction with the XSL URL property.
- If this property is set to Asynchronous, the XSL template is loaded asynchronously and a loading message displays until the template has finished loading.
- If this property is set to Synchronous, the XSL template is loaded synchronously as in General Interface 3.4 and earlier.
To get and set these properties programmatically, see the jsx3.xml.Cacheable.getXslAsync() and jsx3.xml.Cacheable.setXslAsync() in General Interface API Reference.
Note that jsx3.xml.Document.load() fetches the XML resource using XMLHTTPRequest. The XML resource is fetched asynchronously if setAsync(true) is called on the jsx3.xml.Document instance before calling load(). By default, the load is synchronous.
The use of XMLHTTPRequest means that this optimization technique works on the web server configuration to make maximum use of the asynchronous request and caching. For example, adding a long expiration time to resource files can help improve application load time on subsequent startup. However, browsers such as Internet Explorer 6 and 7, which have a connection limit of 2, may not benefit as much from asynchronous loading.
 | Whenever possible, design your application to use asynchronous loading to improve application flow and usability. For more information, see the "Optimizing Application Performance" chapter in the General Interface Developer Guide. |
Property Behaviors
When the XML Async property is set to Asynchronous, the behaviors are as follows:
- Tree and Matrix if the control paints and the data source is not loaded, paints a "Loading data..." message in the body of the control and repaints asynchronously after the data source loads.
- Select and Menu when the control is painted, immediately requests the data source asynchronously. If the control is expanded before the data source has loaded, shows a "Loading data..." message.
- BlockX the same behavior as Tree and Matrix. If the XSL template is also asynchronously loaded, shows a "Loading XSL..." message until the XSL template loads.