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 TypeMethodDescriptionAdds a header action, shown right-aligned in the detail header.Sets the path of the resource that serves a bean-backed detail throughRowDetailMixin.cache(DetailTab.Cache value) Sets how tab content is cached.columns(int n) Sets the default grid column count of the fields tabs.copy()Returns an independent copy, so a shared instance can be attached to several tables.Sets a dedicated endpoint for the tab counts.static RowDetailStarts a row-detail definition for the given per-row GET endpoint.Narrows the fields the generated Details tab shows.static <T> RowDetailStarts a tabbed detail served byRowDetailMixinfrom a bean.Sets the detail panel's icon.static RowDetailinline()Starts a tabbed detail fed from the clicked row's own data, with no server round trip.Sets the URL key of a bean-backed detail (default: the decapitalised simple class name).Sets an explicit label for a field.Returns the element's model block.Sets the detail panel's region.static JsonMapBuilds the detail GET endpoint's own JSON response (not the card fragment).Adds a fields tab.self()Returns this builder.Adds a tab.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
-
modelBlock
Description copied from interface:HandledReturns the element's model block.- Specified by:
modelBlockin interfaceHandled<RowDetail>- Returns:
- The block; never
null .
-
self
Description copied from interface:HandledReturns this builder. -
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.
-
inline
Starts a tabbed detail fed from the clicked row's own data, with no server round trip.The row data includes columns hidden by default. A column that must not reach the browser must not be in the rows endpoint.
- Returns:
- A new
RowDetail.
-
fromBean
Starts a tabbed detail served byRowDetailMixinfrom a bean.- Type Parameters:
T- The bean type.- Parameters:
type- The bean class; only its readable, non-ignored properties can be served.lookup- Finds the bean for a row id, or returnsnull when there is none.- Returns:
- A new
RowDetail.
-
copy
Returns an independent copy, so a shared instance can be attached to several tables.- Returns:
- The copy.
-
action
Adds a header action, shown right-aligned in the detail header.- Parameters:
a- The action.- Returns:
- This object.
-
tab
Adds a tab.- Parameters:
t- The tab. Its id must be unique in this detail.- Returns:
- This object.
-
section
Adds a fields tab.- Parameters:
tabTitle- The tab title.fields- The row fields shown.- Returns:
- This object.
-
fields
Narrows the fields the generated Details tab shows.- Parameters:
names- The field names.- Returns:
- This object.
-
columns
Sets the default grid column count of the fields tabs.- Parameters:
n- The count, 1 to 4 (default 2).- Returns:
- This object.
-
label
Sets an explicit label for a field. It wins over the column label and the bean metadata.- Parameters:
field- The field name.text- The label.- Returns:
- This object.
-
counts
Sets a dedicated endpoint for the tab counts. Without it the counts ride the detail response.- Parameters:
value- A same-origin path template carrying{id}.- Returns:
- This object.
-
cache
Sets how tab content is cached.- Parameters:
value- The policy (defaultDetailTab.Cache.PER_ROW).- Returns:
- This object.
-
key
Sets the URL key of a bean-backed detail (default: the decapitalised simple class name).- Parameters:
value- The key.- Returns:
- This object.
-
basePath
Sets the path of the resource that serves a bean-backed detail throughRowDetailMixin.The endpoint becomes
{basePath}/row-detail/{key}/{id} . Without it the endpoint is relative to the site root.- Parameters:
value- A same-origin path with no placeholders, e.g."/console/pets".- Returns:
- This object.
- Throws:
IllegalArgumentException- Ifvalueis not a safe same-origin path.
-
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.
-