Entity detail/edit page components: form widgets, field grouping, the entity form, parent-context/related-records tables, and the detail page.
Pure Hiccup generators. Depends on base for URL and field helpers.
Entity detail/edit page components: form widgets, field grouping, the entity form, parent-context/related-records tables, and the detail page. Pure Hiccup generators. Depends on `base` for URL and field helpers.
(child-row rel index values errors & [display])One child row of a create form: the fields of rel (see
forms/nested-relationships) named for row index, and a remove button.
One child row of a create form: the fields of `rel` (see `forms/nested-relationships`) named for row `index`, and a remove button.
(detail-tabs entity-name entity-config id)The edit page as the first of the record's tabs, then :detail-tabs, each
:href with {id} replaced by id.
The edit page as the first of the record's tabs, then `:detail-tabs`, each
:href with `{id}` replaced by `id`.(entity-detail-page entity-name
entity-config
record
errors
permissions
&
[opts])Entity detail/edit page.
Args:
entity-name: Keyword entity name
entity-config: Entity configuration map
record: Entity record (nil for create)
errors: Optional validation errors
permissions: Permission flags
opts: Optional map with :flash, :related-records, :display, :workflow,
and :field-options {field [[value label] ...]}, which turns a
text input into a select (a foreign key's parent rows, BOU-563),
and on a create form :nested [{:rel :rows [[index values]]
:row-errors {index errors} :too-few {...}}], the child rows the
parent is created with (BOU-570), and :links, the many-to-many
relations as link-fields in the shell describes them (BOU-778)
Returns: Hiccup page structure
Entity detail/edit page.
Args:
entity-name: Keyword entity name
entity-config: Entity configuration map
record: Entity record (nil for create)
errors: Optional validation errors
permissions: Permission flags
opts: Optional map with :flash, :related-records, :display, :workflow,
and :field-options {field [[value label] ...]}, which turns a
text input into a select (a foreign key's parent rows, BOU-563),
and on a create form :nested [{:rel :rows [[index values]]
:row-errors {index errors} :too-few {...}}], the child rows the
parent is created with (BOU-570), and :links, the many-to-many
relations as `link-fields` in the shell describes them (BOU-778)
Returns:
Hiccup page structure(entity-form entity-name
entity-config
record
errors
permissions
&
[cancel-url display prefill nested links])Render entity create/edit form.
Args: entity-name: Keyword entity name entity-config: Entity configuration map record: Entity record (nil for create) errors: Validation errors map permissions: Permission flags prefill: Optional starting values for a create form
Returns: Hiccup form structure
Notes: If :field-groups is configured, renders fields in grouped sections. Otherwise, renders flat list of editable fields.
Render entity create/edit form. Args: entity-name: Keyword entity name entity-config: Entity configuration map record: Entity record (nil for create) errors: Validation errors map permissions: Permission flags prefill: Optional starting values for a create form Returns: Hiccup form structure Notes: If :field-groups is configured, renders fields in grouped sections. Otherwise, renders flat list of editable fields.
(entity-new-page entity-name entity-config errors permissions & [opts])Entity creation page (convenience wrapper).
Args: entity-name: Keyword entity name entity-config: Entity configuration map errors: Optional validation errors permissions: Permission flags opts: Optional map with :flash
Returns: Hiccup page structure
Entity creation page (convenience wrapper). Args: entity-name: Keyword entity name entity-config: Entity configuration map errors: Optional validation errors permissions: Permission flags opts: Optional map with :flash Returns: Hiccup page structure
(parent-context-banner {:keys [record entity-config display] banner :config})Renders a read-only info strip showing key fields from a parent record. Shown at the top of a child entity edit page (e.g. order-item → order).
Args:
ctx: {:config {:label "Order" :fields [:order-number :status ...]}
:record parent-record-map
:entity-config the parent's config, for each value's role
:display zone, patterns and the record's :overview (ADR-040)}
Renders a read-only info strip showing key fields from a parent record.
Shown at the top of a child entity edit page (e.g. order-item → order).
Args:
ctx: {:config {:label "Order" :fields [:order-number :status ...]}
:record parent-record-map
:entity-config the parent's config, for each value's role
:display zone, patterns and the record's `:overview` (ADR-040)}(related-records-table relationship records & [display])Render a table of related records for a has-many relationship. When :editable true, adds an Edit link per row and a link to create a child with its :foreign-key set to :parent-id. When :has-more? is set, the records are one page of more, and a link leads to the rest.
Args:
relationship: {:label "Order Items" :fields [...] :editable true
:foreign-key :order-id :parent-id "..." :return-to "..."
:has-more? true
:entity-config {...} ; the related entity's, for each cell's role
:overview {...}} ; relation titles of records (ADR-040)
records: vector of record maps (kebab-case keys)
display: Optional display options (zone/date patterns) for value
rendering
Returns: Hiccup table structure
Render a table of related records for a has-many relationship.
When :editable true, adds an Edit link per row and a link to create a child
with its :foreign-key set to :parent-id. When :has-more? is set, the
records are one page of more, and a link leads to the rest.
Args:
relationship: {:label "Order Items" :fields [...] :editable true
:foreign-key :order-id :parent-id "..." :return-to "..."
:has-more? true
:entity-config {...} ; the related entity's, for each cell's role
:overview {...}} ; relation titles of `records` (ADR-040)
records: vector of record maps (kebab-case keys)
display: Optional display options (zone/date patterns) for value
rendering
Returns:
Hiccup table structure(render-field-widget field-name value field-config errors)(render-field-widget field-name value field-config errors display)Render input widget for field based on its configuration.
Args: field-name: Keyword field name value: Current field value field-config: Field configuration map errors: Optional collection of error messages for this field display: Optional display map; a datetime is shown in its zone (BOU-523)
Returns: Hiccup form field structure
Render input widget for field based on its configuration. Args: field-name: Keyword field name value: Current field value field-config: Field configuration map errors: Optional collection of error messages for this field display: Optional display map; a datetime is shown in its zone (BOU-523) Returns: Hiccup form field structure
(with-field-options entity-config field-options)entity-config with each field in field-options rendered as a select
over them — or, given {:url :label}, as a combobox reading its options
there — unless the config chose a widget other than a text input.
`entity-config` with each field in `field-options` rendered as a select
over them — or, given {:url :label}, as a combobox reading its options
there — unless the config chose a widget other than a text input.(with-live-validation entity-config entity-name record-id)entity-config with each field the user can change set to be checked on
the server when it changes: the form posts to validate-field, which answers
with the field again. record-id is nil on a create form.
`entity-config` with each field the user can change set to be checked on the server when it changes: the form posts to validate-field, which answers with the field again. `record-id` is nil on a create form.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |