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.

Regards,
Daniil

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.

Regards,
Daniil

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.

Regards,
Daniil

ScheduleBrowse

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 e.groupname.id = :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

Regards,
Ranji

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.

        @Subscribe
        protected void onBeforeShow(BeforeShowEvent event) {
            mainDl.load();

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

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

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

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

Hopefully its working for you :slight_smile: