Class: Browser

Browser

new Browser()

Encapsulates cross-browser-methods.
A static instance is available as Browser.

Members

<static, readonly> BrowserGetValueAttr :String

Enum for Browser.getValue() Parameter "attr".

Type:
  • String
Properties:
Name Type Default Description
KEY String key

Use to get the Primary Key.

TEXT String text

Use to get the shown text.

VALUE String value

Use to get the value.

STORE String store
SELECTION String selection
OFFSET String offset
FROM String from
TO String to
DATAFIELD String datafield
OPERATOR String operator
SEARCH String search

<static> supports :Object

Object containing informations about the support for different technologies:
touch, orientation, fileApi, geolocation, webWorkers, offline, historyApi

Type:
  • Object

Methods

<static> evalInGlobalContext(code, isFile)

Evaluates javascript code in global context. Variables are declared inside the window namespace and not only in the eval namespace.

Parameters:
Name Type Description
code String

Javascript code as string.

isFile boolean

true, if the code is the content of a file, which was loaded by ajax.

<static> getValue(control, attr) → {String}

Get the value from the given control.

Parameters:
Name Type Argument Description
control Object

Reference to an html element or an upControl object.

attr Browser.BrowserGetValueAttr <optional>

Additional information for target control, depends on target control.

Returns:

Control value

Type
String
Example
Browser.getValue(getElement("[ELEMENT-GUID]"));

<static> setValue(control, value, attr, fireEvent) → {boolean}

Set the value for the given control.

Parameters:
Name Type Argument Default Description
control Object

Reference to an html element or an upControl object, whose value is to be set.

value String | Number | Date | boolean | Object

Control value to set.

attr Object <optional>

Additional information for target control, depends on target control

fireEvent boolean <optional>
true

Trigger the onchange event.

Returns:

Status result.

Type
boolean
Examples
// general
Browser.setValue(getElement("[ELEMENT-GUID]"), "Hallo Welt!");
// Distribution-/Multiselect-Control
// strModus: append | replace
Browser.setValue(getElement("[ELEMENT-GUID]"), ["GUID1", "GUID2"], {bAsync: false, strModus: "append"});
// upDateControl | upDateTimeControl | upTimeControl
// set current date
Browser.setValue(getElement("[ELEMENT-GUID]"), new Date());
// current date + 1 year
Browser.setValue(getElement("[ELEMENT-GUID]"), "+1,,,,,");
// set first day of the current month
Browser.setValue(getElement("[ELEMENT-GUID]"), ",,1,,,");
// upIntegerControl | upCurrencyControl | upFloatControl
Browser.setValue(getElement("[ELEMENT-GUID]"), 1.5);
// upFilterCtrlRangeof | upFilterCtrlCalendar
// set from current date - 5 days until now
Browser.setValue(getElement("[ELEMENT-GUID]"), {from: (new Date()).add("d",-5), to: new Date()});
Browser.setValue(getElement("[ELEMENT-GUID]"), {from: ",,-5,,,", to: ",,,,,"});
// upFilterCtrlOperator
Browser.setValue(getElement("[ELEMENT-GUID]"), {datafield: "datafieldXY", operator: "contains", search: "test"});