Bryan32
(Bryan Schuknecht)
August 21, 2018, 5:25pm
1
Hello all,
I have a RadioButtonGroup defined in a custom web component:
<vaadin-radio-group id="x"></vaadin-radio-group>
I’m injecting this component into the companion Java class. There, it is typed with a custom Enum:
@Id("x")
private RadioButtonGroup<CustomEnum> rbg;
I’m trying to use Binder to select the proper RadioButton when a data object is loaded. I can verify that Binder is doing its job via RadioButtonGroup’s getValue() method.
bean.setProperty(CustomEnum.A);
binder.readBean(bean);
rbg.getValue() (returns CustomEnum.A)
However, the corresponding RadioButton is not visually selected in the browser.
Running rbg.setvalue(CustomEnum.A) from the server-side yields the same result. No radio button is selected in the browser.
Am I missing a step, or is this a bug?
Thanks for reading,
Bryan
Martin.44
(Martin Israelsen)
August 21, 2018, 10:20pm
2
Hi Bryan,
I don’t know if this is related or not. I reported an issue a while back that caused checkboxes to be reset by the client: https://github.com/vaadin/flow/issues/4304
The bug has been marked as closed, but not sure if it has been released in V10/V11 bundles yet.
Martin.44
(Martin Israelsen)
August 22, 2018, 3:17am
3
Perhaps I should mention that the way I noticed the issue was client related was to add a value change listener. It showed that the checkbox was set twice - first time when set/readBean was invoked and the second time after the component was attached.
Bryan32
(Bryan Schuknecht)
August 22, 2018, 4:30pm
5
Hmm… Not sure why my initial reply didn’t post.
Thanks for the reply, Martin!
I read your bug ticket, and yes, this appears to be another issue with component injection via @Id annotation.
I verified that RadioButtonGroup works as expected when the component is not injected through the @Id annotation.
I’ll keep an eye out for the bug fix in a future Vaadin release.
Thanks again,
Bryan