478
| Reference
ClearPass Guest 3.9 | Deployment Guide
View Display Expression Technical Reference
A page that contains a view is displayed in an operator’s Web browser. The view con
tains data that is loaded from the server dynamically. Because of this, both data formatting and display
operations for the view are implemented with JavaScript in the Web browser.
For each item displayed in the view, a JavaScript object is constructed. Each field of the item is defined as a
property of this object. When evaluating the JavaScript Display Expression, the
data
variable is used to
refer to this object. Thus, the expression
data.my_field
would return the value of the field named
“my_field”.
In the above view (the
guest_users
view), the four columns displayed correspond to the
username
,
role_name
,
enabled
, and
expire_time
fields.
Table 54
Display Expressions for Data Formatting
Value
Description
Display Expressions
data.username.bold()
Displays the username string as bold text.
data.role_name
Displays the name of the role.
Nwa_BooleanText(data.enabled, "Enabled",
"Disabled")
Displays either “Enabled” or “Disabled” depending on the
value of the
enabled
field.
(parseInt(data.do_expire) != 0) ?
Nwa_DateFormat(data.expire_time, "%Y-%m-%d
%H:%M") : "N/A"
Displays “N/A” if the account has no expiration time, or a date
and time string if an expiration time has been set.
JavaScript functions
Nwa_BooleanText
(
value
,
if_true
,
if_false
[,
if_undefined
])
Returns the value of
if_true
or
if_false
depending on whether
the
value
evaluates to a Boolean true or false, respectively. If
the value has an undefined type (in other words. has not been
set), and the
if_undefined
parameter was provided, returns
if_undefined
.
Nwa_DateFormat(
value
,
format
)
Converts a numerical
value
(UNIX time) to a string using the
date and time format string
format
. The format string uses
similar syntax to the NwaDateFormat() function.
See
“Date/
Time Format String Reference”
in this chapter for a full list
of the supported format strings.
Nwa_FloatFormat(
value
,
decimals
)
Converts a numerical
value
to a string, with the number of
decimal places specified in
decimals
.
Nwa_MinutesToNatural(
value
)
Converts a numeric
value
measuring a time in minutes to a
natural time representation (such as “2 minutes”, “3 hours”,
“11 days”).
Summary of Contents for ClearPass Guest 3.9
Page 1: ...ClearPass Guest 3 9 Deployment Guide ...
Page 32: ...32 Management Overview ClearPass Guest 3 9 Deployment Guide ...
Page 178: ...178 RADIUS Services ClearPass Guest 3 9 Deployment Guide ...
Page 316: ...316 Guest Management ClearPass Guest 3 9 Deployment Guide ...
Page 410: ...410 Administrator Tasks ClearPass Guest 3 9 Deployment Guide ...
Page 414: ...414 Administrator Tasks ClearPass Guest 3 9 Deployment Guide ...
Page 423: ...ClearPass Guest 3 9 Deployment Guide Hotspot Manager 423 ...
Page 440: ...440 High Availability Services ClearPass Guest 3 9 Deployment Guide ...
Page 518: ...518 Index ClearPass Guest 3 9 Deployment Guide ...