The tl:InfoService and tl:ErrorRenderer allow you to generate three types of messages: warnings, information, and errors.
Improvement
Now, the different messages will not only have different icons in the title to distinguish them from one another, but they will also look different. The messages are color-coded as follows:
- Warnings have a yellow background
- Information messages have a blue background
- Errors have a red background
To make it easier to identify messages in the logs, a timestamp is now added to every warning and error message. This timestamp indicates when the message was generated.
HTML templates now exist for `tl:DefaultInfoServiceItem` and `tl:InfoServiceItemMessageFragment`.
Usage
To achieve this behavior, a CSS class was additionally assigned when creating a tl:DefaultInfoServiceItem object in tl:InfoService. A message that receives this CSS class is then automatically given the desired design. If a command is to be rendered as an Info Service Item, a new tl:DefaultInfoServiceItem object is created.
The new CSS classes are:
- Warnings: “infoServiceWarning”
- Information: “infoServiceInfo”
- Errors: “infoServiceError”
Testing
Launch the application and simulate situations in which messages are triggered on the client side. Navigate to the following tabs in the application:
For Info Service messages: Technical Demo > Layout Framework #1> Forms > Error Page
The documentation in the Main ToolRowView generates a tl:InfoService info message. To replicate such a message, click on the documentation while on a page that does not have documentation—for example, the Error Page in the technical demo.
For messages generated by the tl:ErrorRenderer: Technical Demo > Layout Framework #1 > Forms > Form Controls (inline), and look for the "failWithTopLogicExceptionWarning" button. Test all the "fail" buttons.
To test a dialog window rendered by the tl:ErrorRenderer, the following button has been added to the demo: ThrowErrorDialogWindow.