Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »


Description

The info widget is a versatile labelled widget that can be used to output text. It supports both binding to a unit variable or function and displaying of lang file values directly.

The title is specified as a key to a lang file entry and is required. A tooltip can also be specified as a key to a lang file entry but is optional. Visibility bindings are also supported.



Example


Using the Input Widget with a Lang File Entry

View XML
<info label="info.welcome" tooltip="info.welcome_tooltip" value="info.system_admin_welcome"/>
info.welcome = Welcome:
info.welcome_tooltip = A welcome message
info.system_admin_welcome = Welcome to your landing page




Displaying Dynamic Values Using the Lang File

View XML
<info label="info.welcome" value="info.system_admin_welcome"/>
Backing unit
unit SystemAdminHome;
.
.
string firstName;
string lastName;

void init() {
    currentSystemAdminUser = SystemAdmin:user();
    firstName = currentSystemAdminUser.firstName;
    lastName = currentSystemAdminUser.lastName;
}
en.lang file entries
info.welcome = Welcome:
info.system_admin_welcome = Welcome {SystemAdminHome:firstName} {SystemAdminHome:lastName}




Using the Input Widget with a Binding

<info label="info.email_address">
    <binding function="getSystemAdminEmailAddress"/>
</info>
        
<info label="info.mobile_number">
    <binding variable="currentSystemAdminUser">
        <attribute name="mobileNumber"/>
    </binding>
</info>
Backing unit
SystemAdmin currentSystemAdminUser;
void init() {
    currentSystemAdminUser = SystemAdmin:user();
	.
	.
}
 
// Return the mobile number of the current System Admin user 
string getSystemAdminMobileNumber() {
    return currentSystemAdminUser.mobileNumber;
}
// Return the email address of the current System Admin user
string getSystemAdminEmailAddress() {
    return currentSystemAdminUser.emailAddress;
}
en.lang file entries
info.email_address = E-mail address:
info.mobile_number = Mobile number:


Markdown

The info widget can be allowed to render markdown using the optional "allowMarkdown" attribute. Markdown can be used to create hyperlinks or to otherwise style the text in the info widget.

<info label="info.welcome" value="info.system_admin_welcome" allowMarkdown="true"/>

The following text in an info widget that allows markdown will create a hyperlink.

[Mezzanineware](https://mezzanineware.com)


Additional Mentions and References



  • No labels