Class RowDetail

java.lang.Object
org.apache.juneau.console.views.RowDetail

public final class RowDetail extends Object
Row-detail panel for a table: the per-row GET endpoint, title template, icon and the row-detail region.

CONTRACT_VERSION and response(Object) describe the JSON that endpoint returns.

Example:

table.detail(RowDetail.create("/rest/work/data/{id}") .title("{workId}").icon("search") .region(RegionDef.create("work-detail").populate("work-detail") .allowPopulators("work-detail"))); // The matching endpoint: @RestGet(path="/data/{id}") public JsonMap detail(@Path String id) { return RowDetail.response(store.fields(id)); }

Since:
10.0.0
  • Field Details

  • Method Details

    • create

      public static RowDetail create(String endpoint)
      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 be null or blank.
      Returns:
      A new RowDetail.
      Throws:
      IllegalArgumentException - If endpoint is not a same-origin path with the literal {id} placeholder.
    • title

      public RowDetail title(String template)
      Sets the detail panel's title template.
      Parameters:
      template - A row-data interpolation template, e.g. "{workId}". Can be null to unset.
      Returns:
      This object.
    • icon

      public RowDetail icon(String name)
      Sets the detail panel's icon.
      Parameters:
      name - A glyph name resolved by the shared icon registry. Can be null to unset.
      Returns:
      This object.
    • region

      public RowDetail region(RegionDef value)
      Sets the detail panel's region.
      Parameters:
      value - The region. Can be null to clear it (a header-only panel). Its RegionDef.type defaults to RegionDef.TYPE_ROW_DETAIL and its RegionDef.dataUrl defaults to this detail's own endpoint, applied at toMap() time onto a copy; this method never mutates value itself.
      Returns:
      This object.
    • response

      public static JsonMap response(Object fields)
      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

      public JsonMap 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/icon header from the endpoint's fields) and the entry carries no region key.

      When a region is set, builds from a copy: reads RegionDef.toContractMap() off the caller's region into a fresh map, applies the type/dataUrl defaults onto that copy, and strips the copy's contractVersion key (a card fragment never nests a contractVersion, since the client stamps it on mount). The caller's RegionDef instance is never written to.

      Returns:
      The detail entry.