Package com.onec.ui
Record Class RelatedList
java.lang.Object
java.lang.Record
com.onec.ui.RelatedList
- Record Components:
name- the panel id (unique per entity) and the REST sub-path segmentjoinCatalog- the junction class whose rows model the relationship — a@Catalogor an@InformationRegistervia- field name of theRefon the junction that scopes rows to this record (the back-reference to the owning catalog/document)display- field name of theRefon the junction shown and picked per row (resolved to its description); also the add-row picker's targetcolumns- junction field names to render as columns; empty means justdisplaylabel- panel heading; blank means derive one fromnamehideInDetail- whentrue, the panel renders only in the edit form, not in the read/detail view; defaults tofalseso a declared panel shows in both
public record RelatedList(String name, Class<?> joinCatalog, String via, String display, List<String> columns, String label, boolean hideInDetail)
extends Record
A declarative related-list (inline child rows) panel for a catalog or document view,
backed by a junction — a join catalog or an information register — rather than an owned
tabular section. It gives many-to-many relationships the same inline ergonomics that
@TabularSection gives documents, while keeping a single source of truth: the junction
rows themselves. Both sides of the relationship can mount a panel against the same junction, so
a Booking document and a Client catalog each show "their" rows with no mirroring.
Authored on EntityView.fields(com.onec.ui.EntityConfigBuilder) via
EntityConfigBuilder.relatedList(String, Class):
// In ClinicView.fields(...)
f.relatedList("doctors", ClinicDoctor.class)
.via("clinic") // the Ref<Clinic> that scopes rows to this record
.display("doctor") // the Ref<Doctor> shown / picked per row
.columns("doctor"); // optional extra junction columns (defaults to the display ref)
This is view-only configuration — it adds no tables and changes no schema. The panel reads
live from the junction (rows where via points at the current record). A join-catalog
junction is editable: add/remove create/deletion-mark join rows, reusing the existing Ref
picker and the join catalog's @AccessControl write roles. An information-register
junction (1C's idiomatic M:N store — two ref dimensions) is rendered read-only for now,
since information registers have no generic write REST surface yet.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncolumns()Returns the value of thecolumnsrecord component.display()Returns the value of thedisplayrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehideInDetailrecord component.Class<?> Returns the value of thejoinCatalogrecord component.label()Returns the value of thelabelrecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.via()Returns the value of theviarecord component.
-
Constructor Details
-
RelatedList
public RelatedList(String name, Class<?> joinCatalog, String via, String display, List<String> columns, String label, boolean hideInDetail) Creates an instance of aRelatedListrecord class.- Parameters:
name- the value for thenamerecord componentjoinCatalog- the value for thejoinCatalogrecord componentvia- the value for theviarecord componentdisplay- the value for thedisplayrecord componentcolumns- the value for thecolumnsrecord componentlabel- the value for thelabelrecord componenthideInDetail- the value for thehideInDetailrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
joinCatalog
Returns the value of thejoinCatalogrecord component.- Returns:
- the value of the
joinCatalogrecord component
-
via
Returns the value of theviarecord component.- Returns:
- the value of the
viarecord component
-
display
Returns the value of thedisplayrecord component.- Returns:
- the value of the
displayrecord component
-
columns
Returns the value of thecolumnsrecord component.- Returns:
- the value of the
columnsrecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
hideInDetail
public boolean hideInDetail()Returns the value of thehideInDetailrecord component.- Returns:
- the value of the
hideInDetailrecord component
-