Nuxeo Server

Layout and Widget Display

Updated: October 13, 2017 Page Information Edit on GitHub

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

Layouts can be displayed thanks to a series a JSF tags that will query the web layout service to get the layout definition and build it for a given mode.

The more common way to display a given layout for a document is to use the nxl:layout tag:


<div xmlns:nxl="http://nuxeo.org/nxforms/layout">
  <nxl:layout name="heading" mode="view" value="#{currentDocument}" />
</div>

Layouts that are referenced on a document type definition can use other helper tags, see the corresponding documentation.

You can include a layout in a dataTable tag, but cannot make its mode depend on the iteration variable. If you need to do so, recommendation is to use the c:forEach tag and handle all the <table>, <tr>, <td>... tags by yourself.

For instance, here is a sample display of a listing layout. The layout template is configured to display table rows. It will display header rows when the parameter showListingHeader is true.


<table class="dataOutput">
  <c:forEach var="row" items="#{documents.rows}" varStatus="layoutListingStatus">
    <c:set var="showListingHeader" value="#{layoutListingStatus.index == 0}" />
    <nxl:layout name="#{layoutName}" value="#{row}" mode="view"
      selectedColumns="#{selectedResultLayoutColumns}" />
  </c:forEach>
</table>

Some other advanced tags make it possible to display a global widget for instance, or even to create a widget from scratch by specifying its definition using the tag attributes.

Here is a sample usage of the nxl:widget tag:

<nxl:widget name="widgetName" mode="#{myMode}" value="#{myObject}" required="true" />

Here is a sample usage of the nxl:widgetType tag (creating a widget definition on the fly):

<nxl:widgetType name="text" mode="#{myMode}" value="#{myText}" required="true" />

Please refer to the tag library documentation available at http://community.nuxeo.com/api/nuxeo/latest/tlddoc/nxl/tld-summary.html.


Related section in Studio documentation

Form Layouts

9 days ago manonlumeau NXDOC-1346-FT review screenshot
a year ago Solen Guitter 19
2 years ago Anahide Tchertchian 18
3 years ago Solen Guitter 17 | Fix links to point to latest version
4 years ago Solen Guitter 16 | Added related topics
4 years ago Solen Guitter 15
4 years ago Anahide Tchertchian 14
4 years ago Anahide Tchertchian 13 | add more examples for advanced layouts tag usage
4 years ago Anahide Tchertchian 12 | better title
4 years ago Solen Guitter 11 | Updated link
4 years ago Solen Guitter 10
5 years ago Solen Guitter 8
5 years ago Solen Guitter 9 | Migrated to Confluence 4.0
5 years ago Anahide Tchertchian 7
5 years ago Anahide Tchertchian 6
7 years ago Anahide Tchertchian 5
7 years ago Anahide Tchertchian 4
7 years ago Anahide Tchertchian 3
7 years ago Anahide Tchertchian 2
7 years ago Anahide Tchertchian 1
History: Created by Anahide Tchertchian