Defining Content Panel with HTML Content
This section describes in more detail how you can define a content panel that displays some HTML. As explained before you just need to provide HTML of your content and AwareIM will display this HTML.
tip
You can use tag expressions that refer to the SystemSettings object or LoggedInRegularUser in this HTML, for example<<SystemSettings.Logo>>
.However, what if you want to provide input controls in your HTML? Defining HTML tags for input controls is not difficult, but, you wouldn’t know how to interact with the server – how to initialise your controls and how to submit entered data to the server. AwareIM makes it easy to define such controls as part of your HTML.
When you select “Display HTML” as contents for your panel AwareIM displays a dialog where you can enter your HTML text. On the right-hand side of the dialog there are “Add Input” and “Add Button” links that allow adding text fields, combo-boxes and buttons to your HTML. You define the above widgets not as HTML, but by selecting its properties directly in the dialogs invoked by these links.. Once you finish defining these properties AwareIM generates a special HTML element that contains all the properties that you have specified, and adds this element to your HTML text. You do not have to understand what’s inside this element – all you need to know that at run-time this element will work exactly as you have specified.
note
You can edit the properties of the generated HTML element if you select the HTML code of the element and click on the “Edit…” link.The following section describes the properties of these special HTML elements that you can define in the dialog.
Input Control element
Input controls are text fields or combo-boxes. When defining properties of these elements you must first specify where the resulting value entered by the user will be stored. Since there is usually no Context available for content panels you can only use some attribute of the System Settings or System User object (the user that is currently logged in) or the Session object (a non-persistent business object that is marked as storing session values). So you need to specify which object and which attribute of this object will store the entered value.
When the user submits the value it will be stored in the attribute you have specified and then AwareIM will execute the specified command. For example, you can define a text box to search the messages stored in the database (as in the toolbar of the CRM sample application). You can define a special attribute in the user object called SearchFilter
and the following query:
FIND Message WHERE Message.Body CONTAINS LoggedInRegularUser.SearchFilter
You will provide the SearchFilter attribute as the attribute to store the entered value in and then you will provide the command to run the above query.
Display choices
If the attribute definition that you have specified has choices you can tick this checkbox and AwareIM will display a combo-box instead of the textbox. You can also specify that the choices can be edited by the user.
Initial Value
If the attribute definition that you have specified has initial value defined you can tick this checkbox to display this initial value when the textbox is displayed
Trigger button class
This is only applicable for textboxes. The value is submitted when the user presses the Enter key. In addition you can define a button that will be displayed next to the text box. Clicking on this button will also submit the value.
Width
Width of the control in pixels
Undefined value
The text to be displayed when the control is empty (“Search correspondence” in the picture above)
Button element
This element displays a button that will execute the specified command when the user clicks on it. The button will be styled according to the currently used theme. You can define the following properties:
Command
A command that will be executed when the button is clicked
Button text
Text of the button (optional)
Icon CSS class
CSS class for the icon displayed on the button (optional). See “How to use icons fonts to display an icon for a button” section in the How To Guide.
Width
Width of the button in pixels