Notifications
Commands that display messages or error states to the user.
Messages
Display one or more notification messages to the user.
When to use: Showing success messages, warnings, errors, or informational feedback.
JSON Response:
{
"feCommand": {
"Messages": [
{
"Code": "success",
"Text": "Record saved successfully!"
}
]
}
}
Multiple messages:
{
"feCommand": {
"Messages": [
{ "Code": "warning", "Text": "Please review the entered data." },
{ "Code": "info", "Text": "Some fields may need attention." }
]
}
}
- C# / .NET
- PHP
if (string.Equals(widgetName, "DISPLAYMSGBTN"))
{
response.Set("FECommand", new Dictionary<string, object>
{
["Messages"] = new List<object>
{
new { Code = "warning", Text = "Please review the entered data." },
new { Code = "info", Text = "Some fields may need attention." }
}
});
}
response.Set(HandlerResponse.FormData, request.FormData);
if ($widgetName === 'DISPLAYMSGBTN') {
$response['feCommand']['Messages'] = [
['Code' => 'warning', 'Text' => 'Please review the entered data.'],
['Code' => 'info', 'Text' => 'Some fields may need attention.']
];
}
$response['data'] = $request->all();
Message types (Code field):
| Code | Appearance |
|---|---|
success | Green |
warning | Yellow |
danger | Red |
info | Blue |