(FlowUI) entityComboBox in detail screen not working

I’m not sure if I’m missing something obvious here, but it looks like there are some problems with an entityComboBox in a details screen. All I did was I added a relatedUser to the User entity (starting from a Jmix FlowUI clean project)

    @JoinColumn(name = "RELATED_USER_ID")
    @OneToOne(fetch = FetchType.LAZY)
    private User relatedUser;

Then I tried to add an entityComboBox to the details view with a collection:

...
    <data>
        <collection id="usersDc"
                    class="com.company.flowuitest.entity.User">
            <fetchPlan extends="_base"/>
            <loader id="usersDl">
                <query>
                    <![CDATA[select e from User e order by e.username]]>
                </query>
            </loader>
        </collection>
...
    <layout>
        <formLayout id="form" dataContainer="userDc">
            <entityComboBox id="relatedUserField"
                            property="relatedUser"
                            itemsContainer="usersDc"/>
...

Nothing fancy, but that doesn’t work. The combobox looks a bit broken and there are no items and you can’t select anything.

After a bit of debugging I saw that the items get set before even the InitEvent is triggered. That means, the data for the container is not loaded at this point.

So then I tried to set the items manually in the ReadyEvent via:

    @Subscribe
    public void onReady(ReadyEvent event) {
        relatedUserField.setItems(usersDc);
    }

… but still no luck. Nothing changed, see screen shot:
image

Tried with 1.4.0 and latest 1.5.999-SNAPSHOT

Hi,

Unfortunately, can’t reproduce the issue. Does work for me both one-to-one and many-to-one relation. Could you please attach a sample project that reproduces the problem?

Regards,
Gleb

Ok, got it… Created a completely fresh jmix flow ui project and it worked. Turns out in the other test project I did a quick test with a newer vaadin version - which I reverted - but some frontend artifacts didn’t get cleaned up until I removed the package.json file manually as well.

What I did before that didn’t help:

  • config clean
  • gradle task clean
  • removed .jmix
  • pnpm install
  • delete node_modules

Then I also did the following and got it to work again:

  • gradle task vaadinClean
  • delete package.json as well

Sorry for the false alarm. Maybe the gradle task clean should also clean up the frontend stuff.