
Window lists are controls containing a number of windowinstance objects as entries in list format.
Typically, a window list is bound to a database node and displays and keeps track of all objects in that node. The list may also contain
header or title entries, or other entries based on the context of the list.
A reference to the window list object is available from the environments of all the contained window instances through the
windowlist variable.
Definition

<windowlist name="..."
>
|
|
<class
>
...
</class>
|
The name of the windowclass that is used by default to generate the list entries |
<datasource
>
...
</datasource>
|
A relative (to the window data source) identifier to a database node acting as the list parent |
<allowcreate
/>
|
If given, users can use the radial menu to create new entries in the list |
<allowdelete
/>
|
If given, users can delete entries from the list using the radial menu |
<noscroll
/>
|
If given, the list can't be scrolled; This is useful when the list is used as a dynamically sized control element |
<skipempty
/>
|
If given, the empty entry is not created in lists with no entries |
<useallmodules
/>
|
If given, the list will pull data from all matching data paths in modules as well as the source node. |
<acceptdrop
>
|
Specify that a "shortcut" drag with the specified windowclass will create a new entry in the list. The definition can contain
multiple instances of this element.
|
<class
>
...
</class>
|
The name of the windowclass in the dragdata object containing the dragged shortcut |
<field
>
...
</field>
|
A series of "fields" tags specifying the fields copied to the created window's data source. If the field value is set to "*", then all child database values will be copied. |
</acceptdrop>
|
|
<footer
>
...
</footer>
|
The name of an icon resource to be used as a footer image, i.e. drawn in the control following all entries |
<columns
>
|
Indicates the list should be drawn in columns with the specified width |
<width
>
...
</width>
|
Specifies the width of a column, in pixels |
<filldown
/>
|
Renders the list so that columns are completed before moving to the next column, as opposed to the default case where the number of entries
in columns is equalized.
|
<fillwidth
/>
|
Enters the entries in the list filling rows from left to right before continuing with the next row.
|
</columns>
|
|
<ownedonly
/>
|
If acting as a client, only renders the entries whose data sources are owned by the currently active user |
</windowlist>
|
|
Interface

applyFilter

function applyFilter(
[immediate]
)
Filter the list, using onFilter to select entries for display.
Parameters
immediate (boolean) [optional]
If true, the contents are sorted immediately. Specifying this option might degrade performance, but
be necessary in cases where succeeding script commands require the results of the operation.
applySort

function applySort(
[immediate]
)
Sort the contents of the list, using onSortCompare to place the entries in the desired order.
Parameters
immediate (boolean) [optional]
If true, the contents are sorted immediately. Specifying this option might degrade performance, but
be necessary in cases where succeeding script commands require the results of the operation.
closeAll

function closeAll(
)
This function closes all the windows in the window list.
createWindow

function createWindow(
)
Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the
addition of the new entry.
This form of the function creates a window instance with the window class specified in the definition of the list control, with an automatically
generated data source name.
Return values
(windowinstance)
A
windowinstance representing the created entry, or nil in case of errors.
createWindow

function createWindow(
dbnodeid
)
Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the
addition of the new entry.
This form of the function creates a window instance with the window class specified in the definition of the list control, with a data source
whose identifier string is passed as a parameter.
Parameters
dbnodeid (string)
A database node identifier specifying the created window instance's data source. This value can be absolute or relative to the
list control's own data source.
Return values
(windowinstance)
A
windowinstance representing the created entry, or nil in case of errors.
createWindow

function createWindow(
dbnode
)
Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the
addition of the new entry.
This form of the function creates a window instance with the window class specified in the definition of the list control, with a data source
specified as a databasenode.
Parameters
dbnode (databasenode)
A reference to the data base node to be used as the data source for the created window instance
Return values
(windowinstance)
A
windowinstance representing the created entry, or nil in case of errors.
createWindowWithClass

function createWindowWithClass(
class
)
Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the
addition of the new entry.
This form of the function creates a window instance with the window class specified as a parameter, with an automatically
generated data source name.
Parameters
class (string)
Return values
(windowinstance)
A
windowinstance representing the created entry, or nil in case of errors.
createWindowWithClass

function createWindowWithClass(
class, dbnodeid
)
Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the
addition of the new entry.
This form of the function creates a window instance with the window class specified as a parameter, with a data source
whose identifier string is passed as a parameter.
Parameters
class (string)
dbnodeid (string)
A database node identifier specifying the created window instance's data source. This value can be absolute or relative to the
list control's own data source.
Return values
(windowinstance)
A
windowinstance representing the created entry, or nil in case of errors.
createWindowWithClass

function createWindowWithClass(
class, dbnode
)
Creates a new entry in the list, represented by the returned windowinstance. The list is filtered and sorted automatically after the
addition of the new entry.
This form of the function creates a window instance with the window class specified as a parameter, with a data source
specified as a databasenode.
Parameters
class (string)
dbnode (databasenode)
A reference to the data base node to be used as the data source for the created window instance
Return values
(windowinstance)
A
windowinstance representing the created entry, or nil in case of errors.
getNextWindow

function getNextWindow(
source
)
Retrieve the window instance entry in the list control following the one given as a parameter.
Parameters
source (windowinstance)
The window instance from which the next window is to be determined.
Return values
(windowinstance)
A
windowinstance representing the entry following the given entry. If the entry given as the parameter
is the last one in the list, the return value will be
nil.
getPrevWindow

function getPrevWindow(
source
)
Retrieve the window instance entry in the list control preceding the one given as a parameter.
Parameters
source (windowinstance)
The window instance from which the previous window is to be determined.
Return values
(windowinstance)
A
windowinstance representing the entry preceding the given entry. If the entry given as the parameter
is the first one in the list, the return value will be
nil.
getWindowAt

function getWindowAt(
x, y
)
Retrieve the window instance entry in the list control at the specified coordinates.
Parameters
x (number)
The horizontal position relative to the left edge of the control in its current scroll state, in pixels
y (number)
The vertical position relative to the top edge of the control in its current scroll state, in pixels
Return values
(windowinstance)
A
windowinstance representing the entry at the given position. If no entry was found at the position,
the return value will be
nil.
getWindows

function getWindows(
)
Get the selection of windowinstance objects forming the entries in the list.
Return values
(table)
An integer indexed table containing references to the
windowinstance entries in the list
onFilter

event
function onFilter(
w
)
If this function is defined, it is executed for each record in the window list each time the list is reordered or new entries are added.
Based on the return value, the corresponding record is only shown if it passes the filtering conditions.
Parameters
w (windowinstance)
Return values
(boolean)
A return value of true indicates the entry passes the filter, a value of false hides
it from the currently displayed selection of entries
onListRearranged

event
function onListRearranged(
listchanged
)
If present, this function is called whenever the number or order of entries in the list changed.
Parameters
listchanged (boolean)
If the event causing the invocation of this event added or removed items from the list, the value will be true.
Otherwise, false indicating that only the order of items was changed.
onSortCompare

event
function onSortCompare(
w1, w2
)
When the list is sorted, this function is executed to perform comparison operations between two entries in the list. All entries are not
necessarily compared against each other. The function should perform a greater than operation.
Parameters
w1 (windowinstance)
A reference to a
windowinstance representing the first comparison operand
w2 (windowinstance)
A reference to a
windowinstance representing the second comparison operand
Return values
(boolean)
A return value of true indicates the entry represented by w1 is greater than (should be located later in the list)
than the entry represented by w2. Otherwise, the function should return false.
scrollToWindow

function scrollToWindow(
win, ctrl
)
Scrolls the list to ensure that the given child window is visible. If a control within the child window is also specified, then the function will ensure that the field is visible.
Parameters
win (windowinstance)
A reference to a
windowinstance object representing a child window within the window list.
ctrl (windowcontrol)
A reference to a
windowcontrol object representing a control within the child window.
setColumnWidth

function setColumnWidth(
width
)
Sets the column width for the windowlist. Only relevant in multi-column lists.
Parameters
width (number)
The column width to set
setDatabaseNode

function setDatabaseNode(
dbnode
)
Sets a new data source for the windowlist.
Parameters
dbnode (databasenode)
A reference to a
databasenode object representing the new data source for the window list.