This project demonstrates how to extend an entity and corresponding screens defined in an application component.
Suppose you have Department
entity in your project and you want to add an attribute of this type to the standard User
entity defined in the platform (i.e. in com.haulmont.cuba
component). Please look at the following project items:
-
If you open the
ExtUser
entity in Studio, you can see that it hasUser
in the Parent class field and the Replace parent checkbox is selected. -
There are two
ExtUser
views with the same names as used forUser
in its browser and editor screens. Please notice that they extend base views and add thedepartment
attribute. -
The
ext-user-browse.xml
andext-user-edit.xml
screens extend the corresponding screens from the platform. They have the same identifiers as base screens. -
The message pack of the new screens includes the message packs of base screens. See
com/company/sample/web/extuser/messages.properties
. -
There is a custom main window:
ext-mainwindow.xml
, adding a label for displaying department of a current user. In its controllerExtAppMainWindow
, the user is reloaded with a view containingdepartment
attribute and the department name is set to the label.
Based on CUBA Platform 6.10.1
Please use https://www.cuba-platform.com/discuss for discussion, support, and reporting problems coressponding to this sample.