Class HtmlElement

Represents HTML elements in the SuperOffice UI.

Constructors

HtmlElement()

Initializes a new instance of the HtmlElement class.

Declaration

HtmlElement

Methods

clearValue()

Clears any selected values from elements that support this property.

Declaration

Void clearValue()

Returns

Type Description
Void

getFieldValue(String)

Returns the value of a specific field.

Declaration

String getFieldValue(String field)

Parameters

Type Name Description
String field The name of the field to get.

Returns

Type Description
String The value of field.

getNextTabIndex()

Increments the index counter and returns.

Declaration

Integer getNextTabIndex()

Returns

Type Description
Integer The next valid tab index number.

getTabIndexString()

Retrieves the tabulator index string of the element

A variant of getTabIndexString() that omits element ID if it is the 1st element.

Declaration

String getTabIndexString()

Returns

Type Description
String The tabulator index string of the element.

getTabIndexString(Bool)

Retrieves the tabulator index string of the element and omits element ID if it is the 1st element.

Declaration

String getTabIndexString(Bool noId)

Parameters

Type Name Description
Bool noId Omit element ID if it is the 1st element?

Returns

Type Description
String The tabulator index string of the element.

getTypeName()

Returns the element type. For example, HtmlAnchorLine or HtmlGrid.

Declaration

String getTypeName()

Returns

Type Description
String The element type.

isEmpty()

Returns true if the HtmlElement says it is empty.

Declaration

Bool isEmpty()

Returns

Type Description
Bool True if the HtmlElement says it is empty; otherwise, false.

setDisabled(Bool)

Toggles whether the element is visible or invisible.

Declaration

Void setDisabled(Bool invisible)

Parameters

Type Name Description
Bool invisible True if the element should be invisible.

Returns

Type Description
Void

setErrorMessage(String)

Sets an error message above the element if the form is posted.

Declaration

Void setErrorMessage(String errorMessage)

Examples

HtmlElement page = getHtmlElement("HtmlPage");
page.setErrorMessage("This page contains an error");

Parameters

Type Name Description
String errorMessage The message to set.

Returns

Type Description
Void

setFieldValue(String,Map)

Sets one or more field values on an element.

Declaration

Void setFieldValue(String name, Map values)

Examples

HtmlElement formPage;

Map m;
m.insert("name", "superButton");
m.insert("label", "Click me!");
m.insert("style", "StyleGreen");

formPage.setFieldValue("addButton", m);

Parameters

Type Name Description
String name
Map values Map of values.

Returns

Type Description
Void

setFromCgi()

Called when the element should find its values from the CGI variables.

Declaration

Void setFromCgi()

Returns

Type Description
Void

setInfoMessage(String)

Sets an info message above the element if the form is posted.

Declaration

Void setInfoMessage(String infoMessage)

Parameters

Type Name Description
String infoMessage The message.

Returns

Type Description
Void

setNotEditable(Bool)

Toggles whether the element can be edited (for those elements that support this property).

Declaration

Void setNotEditable(Bool canEdit)

Parameters

Type Name Description
Bool canEdit Can the element be edited?

Returns

Type Description
Void

setValue(String)

Sets the value of a specific element.

Declaration

Void setValue(String value)

Examples

HtmlElement selectDate;
selectDate.setValue("2020.09.10");
HtmlElement t;
t.setValue("x_boolean", "1")

Parameters

Type Name Description
String value Value of the element.

Returns

Type Description
Void

toBool()

Returns the value of the element as a Bool.

Declaration

Bool toBool()

Returns

Type Description
Bool The boolean representation of the element.

toInteger()

Returns the element value as an integer.

Declaration

Integer toInteger()

Returns

Type Description
Integer The numeric representation of the element.

toString()

Returns the value of the element as a String.

Declaration

String toString()

Returns

Type Description
String The string representation of the element.