Facets

Facets are non-visual components that add supplementary behavior to the view or its components.

Built-in Facets

The framework provides the following facets:

To add some facet on the view, use Jmix Studio.

Click Add Component in the actions panel, then select the Facets section, and double-click the selected facet item.

add facet

Studio will create the <facets> element:

<facets>
    <settings auto="true"/>
</facets>

You can view and edit facet attributes in Jmix Studio using the Jmix UI inspector panel.

Custom Facets

The application or an add-on can provide its own facets. To create a custom facet, follow the steps below:

  1. Create an interface extending io.jmix.flowui.facet.Facet.

  2. Create an implementation class based on io.jmix.flowui.facet.impl.AbstractFacet.

  3. Create a Spring bean implementing the io.jmix.flowui.xml.facet.FacetProvider interface parameterized by the type of your facet.

  4. Create an XSD to be used in view XML.

  5. Optionally, create an annotated interface to add support for the facet in the Jmix UI inspector panel of the Studio view designer.

The DataLoadCoordinator and UrlQueryParametersFacet classes of the framework can be good examples of creating a facet.