Item Methods and Properties (inherits Object)

value (rw)

The value property accesses the value of the control for the current row, and can be used to access or update the value. ctrl.value is equivalent to ctrl.getValue(ctrl.getBlock().getQueryRow()) or ctrl.setValue(ctrl.getBlock().getQueryRow(), value) for access or update respectively. It can only be used to access the current row.

void setValue ( number rowNum, string value )

Update value in control

Set the value of a control. The row number does not count displayed rows, rather the row number in the query. Use the block method getQueryRow() to retrieve the current row number. The value for the current row can be accessed directly using the value property described above.

string getValue ( number rowNum )

Get value from control

Fetches the control value for a specified (query) row number. The value for the current row can be accessed directly using the value property described above. If the specified row is not visible, returns an empty value.

void clearValue ( number rowNum )

Clear control value

Clears the control value for a specified (query) row number; in effect this sets the value to null. If the specified row is not visible, the call has no effect.

string getRowValue ( number rowNum )

Get value from underlying query

This is similar to getValue, but the value is returned from the underlying query. Values may be retrieved from any row (not only those for visible records), but may differ from the displayed value if the user has changed but not saved a value.

void setTabOrder ( number order )

Set control tab ordering

void setEnabled ( number rowNum, bool enable )

Enable or disable control

void setVisible ( number rowNum, bool show )

Show or hide control

bool isEnabled ( number rowNum )

Test if control is enabled

bool isVisible ( number rowNum )

Test if control is visible

bool isValid ( number rowNum )

Test if control contents are valid

string errorText ( )

Get the error text for the control

The error text for a data control can be set in the properties for the control. If it not set then text based on the control and and expression is used.

void setReadOnly ( number rowNum, bool readonly, string fgcolor, string bgcolor )

Set read-only state and colours

The read-only state of the control for the specified row is explicitely set, overriding the readonly property. Optionally, the foreground and backgound colours can be set, with colours specified like #C0FFFF. If this method is applied to a block, then it is applied to all controls within that block (and nested containers, but not nested blocks).