Documentation

Designing Object Views

Available Liferay 7.4 U27+ and GA27+

Object views define tables for displaying entries in an Object’s application page. By default, Liferay automatically generates a default view for each published Object definition. This view orders all entry fields alphabetically. You can, however, design custom views to determine which Object fields are included in the table, how the table is sorted, and available filters.

Design custom views for displaying Object entries.

Note

Custom views can only be added to custom Objects. They cannot be added to system Objects.

Follow these steps to design a view for a custom Object definition:

  1. Open the Global Menu (Global Menu), click the Control Panel tab, and go to Objects.

  2. Begin editing a custom Object definition, go to the Views tab, and click the Add button (Add Button).

  3. Enter a name and click Save.

    Enter a name and click Save.

  4. Click the new view to begin editing it.

  5. In the Basic Info tab, check Mark as Default to set it as the default view for the Object definition.

    Note

    This ensures the view is used for the Object’s application page. If no custom layout is selected as default, the Object uses its automatically generated layout.

    Set the view as default.

  6. In the View Builder tab, add columns to the view table.

  7. (Optional) Change or localize the display name for each column.

  8. (Optional) In the Default Sort tab, set the default column sorting.

  9. (Optional) In the Filters tab, select which fields to provide as view filters.

  10. Click Save.

Once saved, the custom view displays the Object’s entries.

Tip

For 7.4 U21+, you can duplicate a view by clicking its Actions button (Actions Button) and selecting Duplicate. This creates a complete copy of the original view with “(Copy)” appended to it’s name.

Adding Columns to a View

In the View Builder tab, add and order fields for the view. Each field added becomes a column in the view table.

Note

Custom views do not support columns containing multiple entries (e.g., Many to Many relationship fields).

Follow these steps to add columns:

  1. Begin editing the desired view and go to the View Builder tab.

  2. Click the Add button (Add Button),

  3. Check all fields you want to include in the view table and click Save.

    Available options include both custom fields and default metadata fields (i.e., ID, Author, Creation Date, Modified Date, and Workflow Status).

    Arrange the fields in any order you want.

  4. Drag and drop fields to determine their order in the view table.

  5. Click Save.

Once saved, the view table only displays the selected fields.

The view table only displays the selected fields.

Renaming Columns

Available Liferay DXP 7.4 U21+ and Portal 7.4 GA21+

Follow these steps to change or localize the display name of view columns:

  1. Begin editing the desired view and go to the View Builder tab.

  2. Click the Actions button (Actions Button) for the desired column and select Edit.

    Click the Actions button for the desired column and select Edit.

  3. Enter a localizable name into the Column Label field and click Edit.

    Enter a localizable name and click Edit.

  4. Click Save.

Once saved, the localized label is used for the view column.

The localized label is used for the view column.

Setting a Default Sorting

Available Liferay DXP 7.4 U18+ and Portal 7.4 GA18+

Follow these steps to set the default ordering/sorting for Object View columns:

  1. Begin editing the desired view and go to the Default Sort tab.

  2. Click the Add button (Add Button).

  3. Select a column and sorting order (i.e., ascending or descending).

    Select a column and sorting order.

  4. Click Save.

  5. (Optional) If you add multiple fields, drag and drop them to determine which is the default sorting. The sorting at the top of the list is the default order applied.

    Arrange fields to determine which is the default sorting.

  6. Click Save.

Object entries are now sorted according to your default sorting.

Adding Filters

Available Liferay 7.4 U27+ and GA27+

When creating a custom view, you can determine which fields are available to users as filter facets. You can also set default filters that are applied automatically to the view.

Follow these steps to add filters to a custom view:

  1. Begin editing the desired view and go to the Filters tab.

  2. Click the Add button (Add Button).

  3. In filter by, select a field.

    Note

    Currently, Objects only supports Workflow Status, Creation Date, Modified Date, and Picklist fields as view filters.

  4. (Optional) Select a filter type: Include or Exclude. This determines whether the default filter includes or excludes entries with the following values.

  5. (Optional) Enter field values to use as a default filter.

    Select a field, filter type, and values.

  6. Click Save.

  7. (Optional) Repeat the above process to add additional field filters to the view.

    Add multiple field filters to the view.

  8. Click Save.

Once saved, users can filter Object entries using the added fields.

Users can filter entries using the added fields.

Also, if you’ve added default filters, they are automatically applied to the view.

Default filters are applied to the view.