Constructors
Extends
Methods
-
addGroup(name)
-
Adds and returns a new option group to group selectable items
Name Type Description namestring the name of the group
- Since:
- Documents 5.0a
-
addSelectableValue(value, label)
-
Adds one value to the list of selectable values
Name Type Description valuestring the value to add
labelstring the label to show for that value
-
addSelectedValue(selectedValue)
-
Adds one (pre)selected value to the list of selected options
Name Type Description selectedValuestring the value to add
-
inherited addStyleClass(styleClass){otris.gadget.gui.Element}
-
Adds a css class to the form field
Name Type Description styleClassstring the style class to be added
Returns:
Type Description otris.gadget.gui.Element current instance for chaining methods -
inherited getAttribute(name){string}
-
Finds and returns the value of a given attribute
Name Type Description namestring the name of the attribute to look for/ return its value
Returns:
Type Description string the value of the given attribute or "" in case the attribute was not found/ empty -
inherited setAttribute(name, value){otris.gadget.gui.Element}
-
Replace or set an attribute
Name Type Description namestring the name of the attribute to replace/ set
valuestring the value to set
Returns:
Type Description otris.gadget.gui.Element current instance for chaining methods -
inherited setEvent(event, handler){otris.gadget.gui.Element}
-
Adds an event handler
Name Type Description eventstring name of the event (e.g.
change)handlerstring the name of the client function (e.g.
myOnchangeFunction)Returns:
Type Description otris.gadget.gui.Element current instance for chaining methods -
inherited setInLine(inLine){otris.gadget.gui.Element}
-
Sets wether or not the form field should be displayed in one line with the previous form field
Name Type Description inLineboolean in same line as previous?
- Default Value:
- false
Returns:
Type Description otris.gadget.gui.Element current instance for chaining methods -
inherited setLabel(label){otris.gadget.gui.Element}
-
Sets the label of the form field
Name Type Description labelstring the new label
Returns:
Type Description otris.gadget.gui.Element current instance for chaining methods -
inherited setMandatory(mandatory){otris.gadget.gui.Element}
-
Sets wether or not the form field will be required to submit the form
Name Type Description mandatoryboolean is the field mandatory?
- Default Value:
- false
Returns:
Type Description otris.gadget.gui.Element current instance for chaining methods -
inherited setReadonly(readonly){otris.gadget.gui.Element}
-
Sets wether or not the form field will readonly
Name Type Description readonlyboolean is the field readonly?
- Default Value:
- false
Returns:
Type Description otris.gadget.gui.Element current instance for chaining methods -
setSelectableValues(selectableValues)
-
Sets the values that can be selected with this SelectableElement
Name Type Description selectableValuesArray an array of arrays containing values and labels
Example
var selectList = form.addSingleSelectList('gender','Gender:'); selectList.setSelectableValues([['m','male'],['f','female']]); -
setSelectedValues(selectedValues)
-
Sets the values that are selected
Name Type Description selectedValuesArray an array of values of the selected options
-
inherited setStyle(name, value){otris.gadget.gui.Element}
-
Set a style attribute of the form field
Name Type Description namestring the name of the style parameter (e.g.
height)valuestring the value of the style parameter (e.g.
100px)Returns:
Type Description otris.gadget.gui.Element current instance for chaining methods -
inherited setValidator(validator)
-
Applies a validator to the input element
A validatorFunction is used to validate the content of the input element
The form can only be submitted if all validators are successfulName Type Description validatorfunction function to validate an input field
validatorFunction(field, gadgetForm, options){validationResult}
The validator function
The field object contains a single field if this validator function is used by otris.gadget.gui.Element#setValidator
The field object contains multiple fields if this validator function is used by otris.gadget.gui.Form#setFormValidatorName Type Description fieldField | object single input field information or object containing mutliple field informations
gadgetFormGadgetForm reference to the GadgetForm
optionsobject options
Name Type Description documentsContextdocuments.sdk.DocumentsContext reference to the documents.sdk.DocumentsContext
Returns:
Type Description validationResult - validation result should be generated via GadgetForm
Example
//validates whether the element value is equal to "otris" element.setValidator(function validateEqualsOtris(field, gadgetForm, options){ var successful = field.value === "otris"; return gadgetForm.createFormValidatorResult(successful, "This value has to equal 'otris'"); }); -
setValue(initialValue)
-
Sets the initial value of the SelectableElement
Name Type Description initialValuestring | Array.<string> initial value or values of the element
Returns:
this element for chaining -
inherited setWidth(width){otris.gadget.gui.Element}
-
Sets the width of the form field
Name Type Description widthnumber the width (in Pixels) of the form field
Returns:
Type Description otris.gadget.gui.Element current instance for chaining methods