EmptyState
TsgcHTMLComponent_EmptyState — the panel a grid, a list or a search result shows when it has no rows: an icon or a picture, a title, a description and up to two buttons, in Delphi, C++ Builder and .NET.
TsgcHTMLComponent_EmptyState — the panel a grid, a list or a search result shows when it has no rows: an icon or a picture, a title, a description and up to two buttons, in Delphi, C++ Builder and .NET.
Set Icon, Title and Description, then read the HTML property; it emits no script at all, so it is safe to push as an out-of-band fragment as often as a page needs.
TsgcHTMLComponent_EmptyState
A single placeholder <div>, no script
Delphi, C++ Builder, .NET
Icon accepts a CSS icon class or inline SVG markup, emitted verbatim after a narrow safety check; never bind end-user input to it — bind untrusted text to Title and Description instead, both always HTML-encoded.
uses
sgcHTML_Enums, sgcHTML_Component_EmptyState;
var
oEmpty: TsgcHTMLComponent_EmptyState;
begin
oEmpty := TsgcHTMLComponent_EmptyState.Create(nil);
try
oEmpty.Icon := 'bi bi-inbox';
oEmpty.Title := 'No results';
oEmpty.Description := 'Try a different search, or clear your filters.';
oEmpty.ActionCaption := 'Clear filters';
oEmpty.ActionHref := '/orders';
oEmpty.ActionStyle := bsPrimary;
WebModule.Response := oEmpty.HTML;
finally
oEmpty.Free;
end;
end;
// Or the one-line static helper for the simple case:
WebModule.Response := TsgcHTMLComponent_EmptyState.Build('No results', 'Try a different search.');
// includes: sgcHTML_Component_EmptyState.hpp
TsgcHTMLComponent_EmptyState *oEmpty = new TsgcHTMLComponent_EmptyState(NULL);
try
{
oEmpty->Icon = "bi bi-inbox";
oEmpty->Title = "No results";
oEmpty->Description = "Try a different search, or clear your filters.";
oEmpty->ActionCaption = "Clear filters";
oEmpty->ActionHref = "/orders";
oEmpty->ActionStyle = bsPrimary;
String html = oEmpty->HTML;
}
__finally
{
delete oEmpty;
}
// Or the one-line static helper for the simple case:
String html2 = TsgcHTMLComponent_EmptyState::Build("No results", "Try a different search.");
using esegece.sgcWebSockets;
var empty = new TsgcHTMLComponent_EmptyState();
empty.Icon = "bi bi-inbox";
empty.Title = "No results";
empty.Description = "Try a different search, or clear your filters.";
empty.ActionCaption = "Clear filters";
empty.ActionHref = "/orders";
empty.ActionStyle = ButtonStyle.bsPrimary;
string html = empty.HTML;
// Or the one-line static helper for the simple case:
string html2 = TsgcHTMLComponent_EmptyState.Build("No results", "Try a different search.");
The members you reach for most often.
CSS icon class or inline SVG (sanitized, drop-on-reject); ImageURL wins over Icon when both are set.
Always HTML-encoded, the safe pair to bind to database or user-supplied text.
The primary call-to-action button, styled through the shared TsgcHTMLButtonStyle enum, default bsPrimary.
A second button, always outline-styled, no style property of its own.
Tighter padding for a small embedded area (a widget, a table body) instead of a whole page/section.
Class function: constructs, sets Title/Description, renders and frees a temporary instance in one call.
| Online HelpFull API reference and usage guide for this component. | Open | |
| All sgcHTML ComponentsBrowse the full feature matrix of 80+ components. | Open | |
| Download Free TrialThe 30-day trial ships the 60.HTML demo projects. | Open | |
| PricingSingle, Team and Site licenses with full source code. | Open |