Package com.onec.ui

Class RelatedListBuilder

java.lang.Object
com.onec.ui.RelatedListBuilder

public class RelatedListBuilder extends Object
Builds one RelatedList panel for a catalog editor. Obtained from EntityConfigBuilder.relatedList(String, Class) inside an EntityView.fields(com.onec.ui.EntityConfigBuilder) lambda.

Chain via(String) / display(String) / columns(String...); call relatedList(String, Class) to add another panel or field(String) to switch back to per-field hints on the same entity.

  • Method Details

    • via

      public RelatedListBuilder via(String field)
      The Ref field on the join catalog that scopes rows to the record being edited — the back-reference to this catalog. Required.
    • display

      public RelatedListBuilder display(String field)
      The Ref field on the join catalog shown (and picked) per row — the "other side" of the relationship. Resolved to its description for display and used as the add-row picker's target catalog. Required.
    • columns

      public RelatedListBuilder columns(String... fields)
      Extra join-row fields to render as columns (e.g. a role or sortOrder attribute on the join catalog). When unset, the panel shows just the display ref. The display ref is always rendered as the row's primary (name) column whether or not it appears here, so an explicit list adds columns on top of the name rather than replacing it; listing the display field is fine and is not duplicated. A field name that matches no attribute on the join catalog (a typo, or a field on a different catalog) is dropped with a WARN at metadata resolution.
    • label

      public RelatedListBuilder label(String label)
      Heading for the panel; blank derives one from the panel name.
    • hideInDetail

      public RelatedListBuilder hideInDetail()
      Hide this panel in the read/detail view, keeping it only in the edit form. By default a related list renders read-only in the detail view (so the roster is visible without entering edit mode) and editable in the form; call this to opt a panel out of the detail render.
    • relatedList

      public RelatedListBuilder relatedList(String name, Class<?> joinCatalog)
      Add another related-list panel on the same entity.
    • field

      public FieldHintBuilder field(String name)
      Switch back to configuring a plain field on the same entity.