Class RowDetail
CONTRACT_VERSION and response(Object) describe the JSON that endpoint returns.
Example:
- Since:
- 10.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe contract version for the detail GET response (the card fragment itself carries no version). -
Method Summary
Modifier and TypeMethodDescriptionstatic RowDetailStarts a row-detail definition for the given per-row GET endpoint.Sets the detail panel's icon.Sets the detail panel's region.static JsonMapBuilds the detail GET endpoint's own JSON response (not the card fragment).Sets the detail panel's title template.toMap()Builds this detail's card-body entry:{endpoint, title?, icon?, region?}.
-
Field Details
-
CONTRACT_VERSION
The contract version for the detail GET response (the card fragment itself carries no version).- See Also:
-
-
Method Details
-
create
Starts a row-detail definition for the given per-row GET endpoint.- Parameters:
endpoint- A same-origin path template carrying the literal{id}row-id placeholder (the client substitutes only that), e.g."/rest/work/data/{id}". Must not benull or blank.- Returns:
- A new
RowDetail. - Throws:
IllegalArgumentException- Ifendpointis not a same-origin path with the literal{id}placeholder.
-
title
Sets the detail panel's title template.- Parameters:
template- A row-data interpolation template, e.g."{workId}". Can benull to unset.- Returns:
- This object.
-
icon
Sets the detail panel's icon.- Parameters:
name- A glyph name resolved by the shared icon registry. Can benull to unset.- Returns:
- This object.
-
region
Sets the detail panel's region.- Parameters:
value- The region. Can benull to clear it (a header-only panel). ItsRegionDef.typedefaults toRegionDef.TYPE_ROW_DETAILand itsRegionDef.dataUrldefaults to this detail's own endpoint, applied attoMap()time onto a copy; this method never mutatesvalueitself.- Returns:
- This object.
-
response
Builds the detail GET endpoint's own JSON response (not the card fragment).- Parameters:
fields- The row's detail fields, a map (or bean) in whatever shape the detail region's populator/renderer expects.- Returns:
{contractVersion, fields}.
-
toMap
Builds this detail's card-body entry:{endpoint, title?, icon?, region?}.The region is optional: a detail with none is a header-only panel (the client fills the
title/iconheader from the endpoint'sfields) and the entry carries noregionkey.When a region is set, builds from a copy: reads
RegionDef.toContractMap()off the caller'sregioninto a fresh map, applies thetype/dataUrldefaults onto that copy, and strips the copy'scontractVersionkey (a card fragment never nests acontractVersion, since the client stamps it on mount). The caller'sRegionDefinstance is never written to.- Returns:
- The detail entry.
-