Click here for general information about scripting in Intrexx.
2. Libraries
In the JavaScript script editor,
you can access the Intrexx Library for Mobile Devices and Intrexx Standard Library on the
Libraries tab.
If you select an entry in the library, you can access these buttons at the
bottom right of this area:
Show description
Shows the description of the currently selected function with an example script.
Open link
Links to the corresponding page that provides more information.
The page that opens also shows the classes, interfaces, methods or properties
that the currently selected function can be used for.
Sets two date fields so that they form the duration of a whole day: dateFrom
00:00 a.m., dateTo 00:00 a.m. next day.
Example
(executable in an onclick() event of a checkbox):
setFullDays(getElement("123401F1E55C9A193BE6EC4091B45C6A5A6C8154"), getElement("DD2E01F1E55C9A193BE6EC4091B45C6A5A6C8154"),
getElement("4D0708BDECC7D088613F818CE1B09B8D812F5750") );
Colors rows and columns in a view table based on a number value. The value
of the color can be set by hexadecimal value or by name. The following
elements can be colored: "row" = whole row (tr), "cell" = whole cell (td),
"span" = text of cell (span)
Example
(color all rows, where value in field viewcontrolD54BA2DD is greater than 10):
Colors rows and columns in a view table based on a date value. Values can be
compared with the current date ("date") or with the current and time
("datetime"). The value of the color can be set by hexadecimal value or by
name. The following elements can be colored: "row" = whole row (tr), "cell"
= whole cell (td), "span" = text of cell (span).
Example
(colors all rows, where date value in field viewcontrolD54BA2DD is less than the current date):
Colors rows and columns in a view table based on a string value. The value
of the color can be set by hexadecimal value or by name. The following
elements can be colored: "row" = whole row (tr), "cell" = whole cell (td),
"span" = text of cell (span).
Example
(colors all rows, where status in field viewcontrolD54BA2DD equals "done"):
Copies text to to clipboard. If sending to clipboard is disabled for
security reasons, a tooltip that the text can be copied from will appear
instead.
Parameters:
param1:
Text or action control. In case of an action control, its target link URL is copied to clipboard.
param2:
Optional parameter as list with following possible values:
strMsgTitle - Title of feedback tooltip.
strMsgBody - Text of feedback tooltip, if text was successfully copied to
clipboard.
bFallback - true (default) or false. If text could not be copied to
clipboard and bFallback is set to true, the text defined in strMsgBody is
displayed.
iTextHeight - Row height within tooltip (default: 1).
iTextWidth - Width of tooltip (default: 50).
strTextStyles - CSS definitions for tooltip.
4.7.7. Locally formatted string from a number string or a datetime string
Creates a locally formatted string from a number string or a datetime string.
The parameter "oHtml" creates a reference to an "integer", "float", "currency" or "datetime" HTML
input control. This HTML control defines type and formatting properties for
the given value. "strValue" defines the value to be formatted.
4.7.8. Format a string and write it in an HTML control
Creates a locally formatted string from a number string or a datetime string and writes the result in an HTML input control.
toLocalString(oHtml, strValue)
oHtml - Reference to an "integer", "float", "currency" or "datetime" HTML
input control. This HTML control defines type and formatting properties for
the given value.
The result is written in this HTML input control.
strValue - String to format
Checks the stated input control as if "Input required" were set OR checks
all controls of a stated form group where "Input required" was set.
Optionally, an alternative text can be defined as the second parameter. This
text is displayed instead of the predefined text in case of errors.
Compares the value of a date control ("date", "time" or "datetime") with the
current date. Can be used for input and view controls. For view controls the
expert attribute "jsobject = true (Boolean)" has to be set.
Possible return values:
-1 if an error occurred or input field is empty.
0 if value is less than current date.
1 if value equals current date.
2 if value is greater than current date.
Snippet
dateComparedToNow(oHtmlDate);
4.11. Add or subtract time interval
Adds or subtracts an interval to/from a given JavaScript date object.
Possible values:
"ms" - milliseconds / "s" - seconds / "mi" - minutes / "h" - hours / "d" - days / "mo" - months / "y" - years
Example
var dtNow = new Date();
var dtAdd1 = dateAdd("d", 1, dtNow); // adds 1 day to current date
var dtAdd2 = dateAdd("h", -2, dtNow); // subtracts 2 hours from current date
dateAdd(typeOfInterval, intValue, oHtmlDate);
4.12. Open page of an application
Executes an application request and opens an application page in a new window.
Example for accessing a
language constant from an application:
ix.text.i18n.getByApp('AB4B031834F042FCADB595DF1923B768C7773F00', 'SHARE_FEED_MORE_COMMENTS')