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:
Tried with 1.4.0 and latest 1.5.999-SNAPSHOT