Show / Hide Table of Contents

Class HtmlElement

Represents HTML elements in the SuperOffice UI.

Syntax

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.

Remarks

The HTML tabindex attribute specifies the tab order of an element. It determines the sequence of entering fields with Tab or Shift+Tab.

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.

Remarks

The HTML tabindex attribute specifies the tab order of an element. It determines the sequence of entering fields with Tab or Shift+Tab.

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.

Remarks

The HTML tabindex attribute specifies the tab order of an element. It determines the sequence of entering fields with Tab or Shift+Tab.

getTypeName()

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

Declaration
String getTypeName()
Returns
Type Description
String

The element type.

Remarks

Look up specific elements in the bLogic screen element reference.

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.

Remarks

That an element is empty means different things depending on the element type. For example, a list element should be empty if it has no rows, but a code element should be empty if it contains no text.

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
Remarks

Commonly used in combination with role-based access.

setErrorMessage(String)

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

Declaration
Void setErrorMessage(String errorMessage)
Parameters
Type Name Description
String errorMessage

The message to set.

Returns
Type Description
Void
Remarks

Used to inform users that something went wrong and attempt to help them out.

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

setFieldValue(String,Map)

Sets one or more field values on an element.

Declaration
Void setFieldValue(String name, Map values)
Parameters
Type Name Description
String name
Map values

Map of values.

Returns
Type Description
Void
Examples
HtmlElement formPage;

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

formPage.setFieldValue("addButton", m);

setFromCgi()

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

Declaration
Void setFromCgi()
Returns
Type Description
Void
Remarks

Commonly used for screens containing forms.

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
Remarks

Used to display the text of a purely informative nature.

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
Remarks

Commonly used in combination with role-based access.

Available from 3.1.8.36

setValue(String)

Sets the value of a specific element.

Declaration
Void setValue(String value)
Parameters
Type Name Description
String value

Value of the element.

Returns
Type Description
Void
Examples
HtmlElement selectDate;
selectDate.setValue("2020.09.10");
HtmlElement t;

t.setValue("x_boolean", "1")

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.

In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top