Добрый день,
Потребовалось сделать свою реализацию ValueSource
. При тестировании обнаружили следующую проблему - в методе AbstractValueComponentDelegate#setValueSource
выполняется приведение valueSource к EntityValueSource
без проверки типа. Вероятно это ошибка, т.к. в других местах тип ValueSource проверяется. Из-за этой проблемы не получается использовать свой ValueSource
с большинством компонентов (textField, textArea и т.д.).
Stacktrace:
java.lang.ClassCastException: class ru.itsyn.jmix_sandbox.view.country.ValueSourceDelegate cannot be cast to class io.jmix.flowui.data.EntityValueSource (ru.itsyn.jmix_sandbox.view.country.ValueSourceDelegate and io.jmix.flowui.data.EntityValueSource are in unnamed module of loader 'app')
at io.jmix.flowui.component.delegate.AbstractValueComponentDelegate.setValueSource(AbstractValueComponentDelegate.java:62) ~[jmix-flowui-2.1.3.jar:na]
at io.jmix.flowui.component.textfield.TypedTextField.setValueSource(TypedTextField.java:158) ~[jmix-flowui-2.1.3.jar:na]
at ru.itsyn.jmix_sandbox.view.country.CountryDetailView.onReady(CountryDetailView.kt:22) ~[main/:na]
at com.vaadin.flow.component.ComponentEventBus.fireEventForListener(ComponentEventBus.java:233) ~[flow-server-24.1.14.jar:24.1.14]
at com.vaadin.flow.component.ComponentEventBus.fireEvent(ComponentEventBus.java:222) ~[flow-server-24.1.14.jar:24.1.14]
at com.vaadin.flow.component.Component.fireEvent(Component.java:411) ~[flow-server-24.1.14.jar:24.1.14]
at com.vaadin.flow.component.ComponentUtil.fireEvent(ComponentUtil.java:416) ~[flow-server-24.1.14.jar:24.1.14]
at io.jmix.flowui.view.ViewControllerUtils.fireEvent(ViewControllerUtils.java:109) ~[jmix-flowui-2.1.3.jar:na]
at io.jmix.flowui.view.DialogWindow.fireViewReadyEvent(DialogWindow.java:244) ~[jmix-flowui-2.1.3.jar:na]
at io.jmix.flowui.view.DialogWindow.onDialogOpenedChanged(DialogWindow.java:224) ~[jmix-flowui-2.1.3.jar:na]
at com.vaadin.flow.component.ComponentEventBus.fireEventForListener(ComponentEventBus.java:233) ~[flow-server-24.1.14.jar:24.1.14]
at com.vaadin.flow.component.ComponentEventBus.fireEvent(ComponentEventBus.java:222) ~[flow-server-24.1.14.jar:24.1.14]
at com.vaadin.flow.component.Component.fireEvent(Component.java:411) ~[flow-server-24.1.14.jar:24.1.14]
at com.vaadin.flow.component.dialog.Dialog.doSetOpened(Dialog.java:853) ~[vaadin-dialog-flow-24.1.12.jar:na]
at com.vaadin.flow.component.dialog.Dialog.setOpened(Dialog.java:840) ~[vaadin-dialog-flow-24.1.12.jar:na]
at com.vaadin.flow.component.dialog.Dialog.open(Dialog.java:456) ~[vaadin-dialog-flow-24.1.12.jar:na]
...