Within a collection, how do I refer to another collection that is defined in the same screen descriptor? I am realizing that I cannot use the “ds” prefix which works for datasources. For example ds$customersDc.
In my screen descriptor I have the following data components:
<instance id="batchDc" class="com.company.lms.entity.Batch" view="batch-view">
<collection id="customersDc" class="com.company.lms.entity.Customer" view="_local">
<query><![CDATA[select e from lms_customer e]]></query>
<collection id="activeCustomersDc" class="com.company.lms.entity.Customer" view="_local">
<query><![CDATA[select e from ds$customersDc e where e.active = 1]]></query>
NOTE: I have simplified my queries just to get help. In the second collection, how do I refer to the first collection ?
I am getting an error when I use ds$customersDc as seen in my code.
It’s a shame that declarative parameters have gone from version 7.0 as this made linking tables a doddle. Now we have to deal with the event handling(lots of repeated code), or use the mixin example, which works after a bit of fixing but seems a bit slow.
You still could use old way of data linking. All you need is to select a ‘Legacy Screen Templates’ tab when you create a screen.
Yes, the problem here is that if you want to have more than two levels of data composition on the screen then you need to use the new screens, and then you need a lot more boilerplate code to knit the tables together.