entityComboBox.setFieldEditable(true/false) causes java.lang.UnsupportedOperationException

Jmix version: 1.3.3
Jmix Studio plugin version: 1.3.7-213
IntelliJ IDEA 2022.1.4 (Community Edition)
Build #IC-221.6008.13, built on July 19, 2022
Runtime version: 11.0.15+10-b2043.56 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Kotlin: 221-1.7.10-release-333-IJ5591.52
Java 17.0.4 2022-07-19 LTS
Java™ SE Runtime Environment (build 17.0.4+11-LTS-179)
Java HotSpot™ 64-Bit Server VM (build 17.0.4+11-LTS-179, mixed mode, sharing)
Operating System: macOS 12.6 (21G115)
File System: Case-Sensitive Journaled HFS+ (APFS)
Datebase: PostgreSQL 13

Hello Everyone

For your information, setting entityComboBox.setFieldEditable(true) or false causes a java.lang.UnsupportedOperationException and I have reproduced this in Mario’s Petclinic example with the following code:

veterinarian-edit.xml

<entityComboBox dataContainer="veterinarianDc" property="specialties" id="entityComboBox"/>

VeterinarianEdit.java

@Autowired
private EntityComboBox<Specialty> entityComboBox;

@Subscribe
protected void onAfterShow(AfterShowEvent event) {
    entityComboBox.setFieldEditable(true);
    getWindow().setCaption(editorTitleLabel());
}

java.lang.UnsupportedOperationException
at io.jmix.ui.component.impl.EntityComboBoxImpl.setFieldEditable(EntityComboBoxImpl.java:177)
at io.jmix.petclinic.screen.veterinarian.veterinarian.VeterinarianEdit.onAfterShow(VeterinarianEdit.java:36)
at io.jmix.core.common.event.EventHub.publish(EventHub.java:170)
at io.jmix.ui.screen.Screen.fireEvent(Screen.java:124)
at io.jmix.ui.screen.UiControllerUtils.fireEvent(UiControllerUtils.java:58)

Please note that this does not occur with the the tagPicker component in the Petclinic example. Thanks in advance for correcting this.

Best regards
Chris

Hi,

entityComboBox doesn’t support setFieldEditable method. This method is only available for EntityPicker. If you describe your task, I’d try to suggest a solution.

Regards,
Gleb

@gorelov

Hi Gleb

Thank you for the quick feedback. I do not actually need this method; I simply found this error after I replaced my EntityPicker with the EntityComboBox. And since the studio code-completion still provides this method as a possible selection, I could only assume that it is supported. Then I guess it should just be removed from the code-completion options but that is your decision. Thanks again.

Best regards
Chris