How can I create entities having the same basic Enity, so that I can show different entities in the same view based on the basic entities.
Hi,
You should create a screen according to this example. Here we have two entities with the same parent. For each entity, we create a collectionDatasource and a table with this datasource. For creating or updating entities you should generate standards screens.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
caption="msg://caption"
class="com.company.sameparent.web.screens.Screen"
messagesPack="com.company.sameparent.web.screens">
<dsContext>
<collectionDatasource id="firstChildDs"
class="com.company.sameparent.entity.FirstChild"
view="_local">
<query>
<![CDATA[select e from sameparent$FirstChild e]]>
</query>
</collectionDatasource>
<collectionDatasource id="secondChildDs"
class="com.company.sameparent.entity.SecondChild"
view="_local">
<query>
<![CDATA[select e from sameparent$SecondChild e]]>
</query>
</collectionDatasource>
</dsContext>
<layout>
<table height="100px"
width="200px">
<columns>
<column id="first_name"/>
<column id="parent_name"/>
<column id="parent_date"/>
</columns>
<rows datasource="firstChildDs"/>
</table>
<table height="100px"
width="200px">
<columns>
<column id="second_name"/>
<column id="parent_name"/>
<column id="parent_date"/>
</columns>
<rows datasource="secondChildDs"/>
</table>
</layout>
</window>