Simple DataCollection Reference JPQL

Should be easy but I cannot figure it out. I think I tried everything from the docs.

I have some edit screen with a main data instance, let’s say “companyDc”.
The company entity has a field “city” which is a simple string, no reference.
I want to add a table to the edit screen with all companies in the same city.

So i create a new datacollection “otherCompaniesInTheSameCityDc”.
What is the correct query syntax for “select e from xx_company e where =

Mentioning here, replacing by some static string 'Berlin' works.

I tried everything i found in the docs like “:param, :component, :container...”, underscores, dollar-signs, jpql_conditions (<condition>...</condition>).


It’s not possible to do what you need by using only XML definition.

You should introduce a custom argument in the query and assign value for this argument in the screen controller (e.g. in BeforeShowEvent handler).

Example of query in data loader:

select e from xx_company e where = :companyCity

Then set this parameter in screen controller before the data is loaded:

    private CollectionLoader<Company> otherCompaniesInTheSameCityDl;

    private InstanceContainer<Company> companyDc;

    private void onBeforeShow(BeforeShowEvent event) {

1 Like

I did it as described and it works for a data collection.
Now i wanted to do the same with a data instance and i get an “access denied”.

    <instance id="wassetDc" class="com.test.entity.Wasset">
        <view extends="_local"/>
        <loader id="wassetDl">
                <![CDATA[select e from vtw_Wasset e where e.str= :str]]>


private InstanceLoader<Wasset> wassetDl;

public void onBeforeShow(BeforeShowEvent event) {
   wassetDl.setParameter("str", "somestring");

Same thing works with a Collection Loader instead od Instance Loader
It also works with a static query

<![CDATA[select e from vtw_Wasset e where e.str= 'somestring']]>

The message “Access Denied” when i open the Browser does not really help me.