SparseWare

System Variables

System variables are embeddable variables that provide global or context specific information. System variables always start with a percent sign (%). If there is a path preceding the system variable, then the path is used to find the widget context to resolve the variable against. If the system variable is not preceded by a path, then the variable is resolved within the current widget context.

For example, to access the current selection in the 'states' list within the 'demographics' form you would use '/demographics/states/%selectionValue'. You could also use 'states/%selectionValue' if the widget that is accessing 'states' value is also in the �demographics� form. If you want access the value within an event on the 'states' widget, then all that is needed is '%selectionValue'.

Below is an example of embedding a system variable reference to generate the value for a popup menu:
popupMenu {
  {
     icon: "resource: Sage.icon.save"
    value: "{resource: Sage.text.save} {/ordersTable/%selectionValue[2]}"
  } [ onAction="saveOrdersTableSelection()" ]
}
	
The table below contains a list of the available system variables.

VariableResolves to
%applicationURL the URL that created the application
%baseURL the widget�s base URL
%codeBase the the codebase for an application launched via webstart
%columnName[n] the name of the specified column (n)
%contextURL the widget�s context URL
%documentBase the documentbase for an applet or the codebase for an application launched via webstart.
%domainValue the selected domain value on a chart
%name the name of the current widget
%rangeValue the selected range value on a chart
%rowCount the number of rows the widget currently contains
%selectionColumn the index of the currently selected column
%selectionColumns the array of currently selected columns as a comma separated list enclosed in barckets
%selectionData the linked data for the current selection for the widget (can be shortened to just %data)
%selectionData[n] the linked data of the specified column (n) for the current selection for the widget
%selectionRow the index of the currently selected row
%selectionRows the array of currently selected rows as a comma separated list enclosed in barckets
%selectionValue the value of the current selection for the widget (can be shortened to just %value)
%selectionValue[n] the value of the specified column (n) for the current selection for the widget
%serverBase the servers�s base url (http://server:port/)
%submitValue the value that would be submitted for the widget during a HTTP form submission
%title the widget�s title