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
ExtUserentity in Studio, you can see that it hasUserin the Parent class field and the Replace parent checkbox is selected. -
There are two
ExtUserviews with the same names as used forUserin its browser and editor screens. Please notice that they extend base views and add thedepartmentattribute. -
The
ext-user-browse.xmlandext-user-edit.xmlscreens 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 containingdepartmentattribute 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.