Skip to end of metadata
Go to start of metadata
In this page we provide samples to have a selection widget with 3 levels by contributing a "template widget" in Studio. Each sample code below is the sample for one widget that has a different behavior (described before the code).

To create and use a new widget:

  1. Copy-paste the sample of your choice in a file that you call, for instance, "3_level_select_widget.xhtml".

    Icon

    Of course you can modify the samples below to add other levels, or other behaviors. You just need to be familiar with facelets and JSF.

  2. Upload this file in the Resources > Widgets section.
    The widget is created. You can now use it on layouts and forms.
  3. In the layout of the document type where you want to use the widget, drag and drop the Template widget from the Advanced Widgets category on the right.
  4. Edit the properties of the widget.
    Here are the properties specific to custom widgets that you need to fill in.
    • Template: choose the XHTML file you have just uploaded.
    • Fields: add one field and put the XPath of the field you want to update. For instance, "dc:coverage".
    • Custom properties configuration: in our sample, you can (should) add those three properties labels and put the value you need:
      • localize
      • required
      • directoryName (should be the name of the vocabulary that holds the values that are displayed).

Widget samples

Mono-select 3-level widget

Sample example on 3 levels with widget property "directoryName" filled with the directory name (mono select):

Multi-select 3-level widget

Sample example on 3 levels with widget property "directoryName" filled with the directory name (multi select):

Complete examples with CSV (plain) and PDF rendering (5.4.1)

Mono-select widget

Multi-select widget

Related howtos: