Dependent lookupfield in cuba 7

Dependent lookupfield query is not working

for eg: projectTitle lookupfield depends on employee lookupfield

Hello @ranjisona

Could you describe your task in more details? Please share screen layout and controller to be more clear.


I have attached screenshotlookupfield

Unfortunately I do not see any LookupField on the screenshot.

Please share some sample project that contains an example we are talking about.


I upload xml file of my project

in that two dependent field query is not working:

Could you clarify what you want to do?

Topic title and first message are about LookupField, but later you share the screenshot only with data containers and no LookupField component can be found.



I have mentioned the lookupField screenshot in this xml.

If i select the groupname the corresponding botname alone should be display, but in my case botname shows all the items either whatever the groupname is selected.

But in cuba version 6.10 i got a solution with the use of following Query:
select e from botmanagementsystemnew$BotMaster e where = :ds$groupnamesDs

I have tried it on cuba version 7.0 with the following query
select e from botmanagementsystem_BotMaster e where e.groupname = :groupname

But it throws an errors like this,Query%20Error


Hello, for the case that you attached below.
I was also face same problem with this, so here is my workaround to solve this issue.
I create onBeforeShow Event to the controller and then inject the CollectionLoader from the UI.
And then assign the parameter for the children (dependent) dataloader with the some value (e.g “00000000-0000-0000-0000-000000000000”) that not match to any data in your database.

        protected void onBeforeShow(BeforeShowEvent event) {

            childDl00.setParameter("parameter1", UUID.fromString("00000000-0000-0000-0000-000000000000"));

            childDl01.setParameter("parameter2", UUID.fromString("00000000-0000-0000-0000-000000000000"));

        @Subscribe(id = "mainsDc", target = Target.DATA_CONTAINER)
        protected void onMainsDcItemChange(InstanceContainer.ItemChangeEvent<Object> event) {
            childDl00.setParameter("parameter1", event.getItem().getId());

            childDl01.setParameter("parameter2", event.getItem().getId());

Hopefully its working for you :slight_smile: