ScriptLabelledSingleQObject

From Q
Jump to navigation Jump to search

ScriptLabelledSingleQObject

Represents a labelled combobox (drop down) control, which lets the user select input data. The control is created by the RuleForm object's inputData() function. This is only available in R Controls and not Rules.

getIndex()

Retrieves the index of the selection.
Returns:The index of the selection, or -1 if no alternative is selected.

getValue()

Retrieves the alternative selected.
Returns:One of the alternatives passed to newComboBox(), or the default if none, or null if no default has been set.

lineBreakAfter

Use this where your Rule has many controls, and they do not fit comfortably in a single line. It allows you to specify that a new row will be started after this control.
Example:
c.lineBreakAfter = true;

requireValue()

Retrieves the alternative selected. If no alternative has been selected and no default has been set then the script will end immediately and this control will be marked invalid.
Returns:The text of the alternative chosen, or the default if none.

setDefault(alternative)

Set a default.
alternativeOne of the alternatives used to create this control.

type

Returns the name we use to refer to this class in the documentation.