Problem with generate handler for instanceloader

Hi,

I am using Jmix version: 2.1.1 Jmix Studio plugin version: 2.1.0-232 IntelliJ version: IntelliJ IDEA 2023.2.4 (Ultimate Edition) and faced the following problem.

If I generate loadDelegate from the controller for an instanceloader with Generate Handler, it generates the code like this (eg. in case of the entity is CustomerDTO):

@Install(to = "customerDTODl", target = Target.DATA_LOADER)
    private Object customerDTODlLoadDelegate(final CustomerDTO customerDTO) {
        return null;
    }

But this doesn’t work, IllegalArgumentException: argument type mismatch is thrown. If I change the method parameter to LoadContext, it works properly:

@Install(to = "customerDTODl", target = Target.DATA_LOADER)
    private Object customerDTODlLoadDelegate(final LoadContext<CustomerDTO> loadContext) {
        return null;
    }

Could you please check it?
Thank you in advance,
and best regards,
Beatrix

Hi,
That problem has been fixed in the latest Studio release.
You can update Studio plugin to the latest version and check handler generation.

Note, that your data container should have attribute ‘class’ in view xml descriptor.

Regards,
Mikhail

Hi Mikhail,

oh, great, thank you for the information!

Yes, of course the data container has the ‘class’ attribute in view xml descriptor. Thank you for the notice. :slight_smile:

Regards,
Beatrix