primary
- Parameters:
v- The new value.- Returns:
- This object.
<@card type="datatables"> JSON5
for apps that build pages in Java, and toCardBody() serializes to exactly the card body the FTL path
produces. All behavior (paging, search, rendering, actions) stays in juneau-views.js; this type never
calls a card-type handler directly — see the class's rendering note on toCardBody().
Column.defaultVisible(false) only hides a column when the client's
columnConfig (juneau-config.js) is on.
TableSpec
static enum static enum bulk(BulkMutateDef value) cleanAddress(boolean v) columnConfig(boolean v) columnConfig(Map<String,Object> options) columnConfig object (for example
{"chooser": true}).columns()copyLink(boolean v) static TableSpeccssClass()dataMode(TableSpec.DataMode mode) dataUrl on every draw.defaultOrder(String column,
TableSpec.Sort dir) detail()id()operators(SearchOperatorSet table) SearchOperatorSet, inherited by any searchable column that declares
none of its own.pausePollingWhileEditing(boolean v) pollIntervalMs(long ms) primary(boolean v) quickStats(String id,
QuickStat... items) ribbon(RibbonItem... items) rowActions(List<RowAction> actions) rowActions(RowAction... actions) TableCatalog did — documentation metadata only; it has no
effect on rendering or validation.selection(SelectionDef value) contractVersion anywhere (the client stamps every
contract version).urlStateDayParam(String param) day URL-state directive and names the request query parameter it sends the selected day under.voidvalidate()id - The table's card id. Must not be ^[A-Za-z][A-Za-z0-9_-]{0,63}$.TableSpec, with no columns or dataUrl yet set.IllegalArgumentException - If id is TableCatalog did — documentation metadata only; it has no
effect on rendering or validation.type - The row type. Can be name - The row type name. Can be url - The URL. Required by validate().dataUrl on every draw.mode - The mode. Defaults to TableSpec.DataMode.CLIENT when never called (omitted from the wire, since
juneau-views.js already defaults to client mode).column - The column name. Must not be dir - The sort direction. Must not be IllegalArgumentException - If column is dir is cols - The columns. Must not be IllegalArgumentException - If cols names a Column.name() already appended by an
earlier call.SearchOperatorSet, inherited by any searchable column that declares
none of its own.table - The operator set. Can be items - The items. Must not be juneau-views.js's evaluateRowClassRules):
a row whose field is eq/ne the given value gets cssClass added
to its <tr>.field - The row-data field to test. Must not be op - The operator. Must be Op.EQ or Op.NE.value - The comparison value. Must not be cssClass - The CSS class to add on a match (serialized as the wire key class). Must not be
IllegalArgumentException - If any argument is missing, or op does not take a value.field is present/
absent gets cssClass added to its <tr>.field - The row-data field to test. Must not be op - The operator. Must be Op.PRESENT or Op.ABSENT.cssClass - The CSS class to add on a match (serialized as the wire key class). Must not be
IllegalArgumentException - If any argument is missing, or op requires a value.actions - The actions. Must not be actions - The actions. Must not be value - The detail config. Can be value - The selection config. Can be selection(SelectionDef) to also be set.value - The bulk config. Can be ms - The interval in milliseconds. Must be positive.IllegalArgumentException - If ms is not positive.id - The strip's own id, serialized as quickStats.id. Must not be items - The tiles, in display order. Must not be empty.IllegalArgumentException - If id is items is empty.
Each name selects one of the built-in directives (day, ids or window); any other name is
refused, because this method does not register codecs and the page contract only carries the built-ins. A name
not yet declared is emitted as an empty configuration object, which means the directive's defaults; a name already
declared keeps its configuration (for example a day param set by urlStateDayParam(String)). This
method never clears configuration. Directives are emitted in the order they were first declared. The call is
atomic: every name is validated before any is declared, so if one is refused nothing is changed.
names - The directive names; each one of day, ids or window.IllegalArgumentException - If a name is null, blank or not a built-in directive.day URL-state directive and names the request query parameter it sends the selected day under.
urlState("day") sends the day as a day parameter; this form is for a server whose parameter has
another name. The directive is emitted as urlState.day.param, in the position day was first
declared. Calling this again replaces the parameter name (the last call wins).
param - The query-parameter name; must match ^[A-Za-z][A-Za-z0-9_-]{0,63}$.IllegalArgumentException - If param is null, blank, or malformed.
This is the configurable form of urlState(String...) for the three built-in directives; every option the
client's built-in codecs accept can be expressed, so a page needs no hand-written map to configure one:
ids — param (request parameter name, default ids) and max (an integer
>= 1, default 200).
window — params, a map that may hold start and/or end (the request
parameter names, defaults start/end).
day — param (request parameter name, default day); same as
urlStateDayParam(String).
Restrictions (deliberate, so the wire contract and the builder agree): every parameter name must match
^[A-Za-z][A-Za-z0-9_-]{0,63}$ (the same grammar as day.param), and max must be an integer
(Integer, Long, Short or Byte) of at least 1. The client's own fallbacks for a falsy, string or fractional
max, or for an unusual parameter name, are refused here rather than reproduced. The result is the same
value an FTL page writes as urlState: {ids:{param:'pid',max:50}}.
Merge, not replace. The options are merged into any entry already declared for name: each option
given here overwrites the same option declared earlier (the last call wins, as with urlStateDayParam(String)),
options not named here are kept, and window.params is merged key by key. Like urlState(String...)
this never clears configuration, and an empty map just declares the directive. The directive keeps the position it
was first declared in. The call is atomic: if any option is refused, nothing is changed.
name - The directive name; one of day, ids or window.config - The directive options; deep-copied, so later changes to the map have no effect. Must not be null.IllegalArgumentException - If the name is null, blank or not a built-in directive, the config is null, or an option is unknown for a
built-in directive, mistyped, or out of range (a parameter name that is malformed, a max that is not a
positive integer, a window.params key other than start/end).v - The new value.v - The new value.columnConfig object (for example
{"chooser": true}).options - The options, copied at call time. Must not be v - The new value.v - The new value.v - The new value.toCardBody().value - The class list. Can be columns(Column...) and rowClass, and an unknown export button
by RibbonItem.export(String...), so none of those can be seen here.IllegalStateException - If any check fails.contractVersion anywhere (the client stamps every
contract version). This is the only place in this type that knows the datatables wire shape. The result is
the unwrapped catalog the datatables card type reads, and is rendered the same single way
<@card> is, by the page mixin's cardTypes.toCard(CardSource.create("datatables", id())
.bodyMap(toCardBody()).build()); this type never calls a card-type handler directly.
The body holds only plain data (maps, lists, strings, numbers, booleans), the same shape a parsed body has.
Each column carries its effective operator set (its own, else operators(SearchOperatorSet)).