Nuxeo Server

Layout and Widget Modes

Updated: December 5, 2017 Page Information Edit on GitHub

This page is scheduled for review and update. Check back soon for updated content!

Both layouts and widgets have modes, that makes it possible to render the same layout in different use cases, even if some only support a simple "view" mode.

The layout modes can be anything although some default modes are included in the application: create, edit, view. Some additional modes are available: listing, search, bulkEdit, header, csv, pdf and plain.

The widget modes are more restricted and widget types will usually only handle two modes: edit and view. Some additional modes are available by default: pdf, csv and plain (very close to the view mode except it's not supposed to include HTML tags). These additional modes are useful when exporting listings. The widget mode is computed from the layout mode (or from its parent widget mode).

Here is a table of the default mappings:

Layout Mode Default Widget Mode
create, edit, search, bulkEdit edit
view, summary view
csv csv
pdf pdf
any other value plain

The pseudo mode any is only used in layouts and widgets definitions to set up default values.

It is possible to override this behavior in the widget definition and state that, for instance, whatever the layout mode, the widget will be in view mode. This enables to make the widget display only read-only values. The pseudo-mode hidden can also be used in a widget definition to exclude this widget from the layout in a given mode.

It is also possible to use expressions to resolve this mode, for instance the following expression can be used to hide a widget displaying the dublincore field named format in view mode if this property is not filled on the document:

<widgetModes>
  <mode value="view">#{empty layoutValue.dc.format?'hidden':'view'}</mode>
</widgetModes>

See Field Binding and Expressions for more information about available expression variables.


Related pages in current documentation
Related pages in Studio documentation
5 days ago Manon Lumeau add tags for doc days
a month ago manonlumeau Added content-review-lts2017 label
2 months ago manonlumeau NXDOC-1346-FT review screenshot
a year ago Solen Guitter 9
3 years ago Anahide Tchertchian 8 | NXDOC-286: give example for mode configuration with expressions
3 years ago Anahide Tchertchian 7 | NXDOC-286: cosmit
3 years ago Solen Guitter 6 | Remove 5.4 reference
4 years ago Solen Guitter 5
4 years ago Solen Guitter 4 | Added related topics and links, removed 5.4.2 mentions
4 years ago Anahide Tchertchian 3
4 years ago Anahide Tchertchian 2
4 years ago Anahide Tchertchian 1
History: Created by Anahide Tchertchian