Button & setPropertyDataSource

Hi guys.

Is there an approach to handle the readonly button state via Property as it was in Vaadin 6 like

ObjectProperty<Boolean> somePropety = new Objectproperty<>(Boolean.FALSE);
btn.setPropertyDataSource(someProperty);

// after you can just call
someProperty.setReadonly(tru);

// and voila! we have the readonly-state button

if not, what’s the best way to do such stuff? or correct me, if I understood smth wrong.

Why not simply btn.setReadOnly()?

Something like this (Java 8 code below):

ObjectProperty<Boolean> somePropety = new Objectproperty<>(Boolean.FALSE);
someProperty.addValueChangeListener(e -> btn.setReadOnly(e.getValue()));

// after you can just call
someProperty.setReadonly(tru);

Hi Michael. Thanks for your reply. Yeah, I already did the same thing you’ve written above, just don’t have time to post reply here

Best rgrds.
Jenia