Requires Platform 4.2+; Requires Data Framework Plug-in top
A data source is an object capable of supplying objects and data sets based on query strings.
...
In addition, developers may create their own data sources, see "Creating a Data Source" for complete information.
Supplied Tags
Nexaweb 4.2.x provides the following pre-built data source tags:
...
Attribute | Description | Required/Optional |
source | A path to the location of the data. Use any of the following formats:
The default is null. Note: If you do not specify a source, Nexaweb expects the source to be set programmatically later on. | Optional |
id | Uniquely identifies the data source using a system wide unique value. | Required |
documentName | Registers the source document retrieved from the source in the DocumentRegistry. This attribute essentially translates into a loadDocumentFromUrl(sourceUrl, documentName) call. If the documentDataSource tag does not specify a source, the documentName attribute has no effect. To set the source and register the document in the DocumentRegistry programmatically, use one of the following API methods:
| Optional |
refreshOnAttributeChange | Specifies whether to refresh the datasource when attribute change events fire on any element in the source document. Values: true | false Default: true | Optional |
refreshOnStructureChange | Specifies whether to refresh the datasource when structure change events fire on any element in the source document. Values: true | false Default: true | Optional |
...
Attribute | Description | Required/Optional |
source | Specifies the path to the object to wrap. Specify path using one of the following formats:
| Optional |
id | Uniquely identifies the data source using a system wide unique value. | Required |
refreshOnPropertyChange | Specifies whether to refresh the datasource when property change events fire on the source object. To enable datasource refresh, you must:
Values: true | false | Optional |
...
Expression | Description |
"bar | Returns the value of the bar variable. |
"bar=10" | Sets the variable to 10. |
"myVector.addElement(new Integer( bar ))" | Adds an integer value of bar to the myVector. |
"myVector.{delegate()}" | Calls delegate() method on each element contained in myVector and returns a new list that contains the return values of those calls. |
"myVector.size().(#this > 100? 2*#this : 20+#this)" | the size of the Vector gets bound to #this variable (#this always refers to the current value of an OGNL expression), then the expression that follows gets evaluated returning one of the outcomes. |
...
Creating a Data Source
As part of the data binding framework, Nexaweb provides you with the ability to implement your own custom data sources. For example, you can implement your own functionality to load data from a database or to provide access to a custom set of objects. In order to implement the functionality of a data source, you must implement the required interface (com.nexaweb.plugin.data.datasource.DataSource) as defined in the API section.
...