Designing Object Views¶
Available Liferay DXP 7.4 U10+ and Portal 7.4 GA14+
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. This view orders all entry fields alphabetically. You can, however, design custom views to determine which Object fields are included in the table and how they’re ordered.
Custom views can only be added to custom Objects. They cannot be added to system Objects.
Follow these steps to design a custom Object view:
Open the Global Menu (), click the Control Panel tab, and go to Objects.
Begin editing the desired Object.
You can add views to both draft and published Objects.
Go to the Views tab and click the Add button ().
Enter a name and click Save to create a new blank view. You can now add fields to it.
Click the view to begin editing it.
In the Basic Info tab, determine whether to use the view as default.
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.
Go to the View Builder tab and click the Add button ().
Check all fields you want to include in the view table and click Save. Each selected field is used as a column in the application page table.
Available options include both custom fields and general metadata fields (i.e., ID, Author, Creation Date, Modified Date, and Workflow Status).
Views do not support columns containing multiple entries (e.g., Many to Many relationship fields).
Drag and drop fields to arrange their order.
(Optional) Change or localize the display name for each view column.
Once saved, the custom view is used to display the Object’s entries.
For 7.4 U21+, you can duplicate a view by clicking its Actions button () and selecting Duplicate. This creates a complete copy of the original view with “(Copy)” appended to it’s name.
Available Liferay DXP 7.4 U21+ and Portal 7.4 GA21+
Follow these steps to change or localize the display name of view columns:
Select the desired view and go to the View Builder tab.
Click the Actions button () for the desired column and select Edit.
Enter a localizable name into the Column Label field and click Edit.
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:
Select the desired view, go to the Default Sort tab, and click the Add button ().
Select a column and sorting order (i.e., Ascending or Descending).
Object entries are now sorted according to your default sorting.
If you create multiple default sorts, you can rearrange them to determine which is applied to the view. The view uses the sort that’s placed first.