Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Events Disabling
Hi, All! Is it possible in some cases to disable component fom calling it's valueChange event, when you use .setValue(null), except removing and adding it's listener?!
Haven't seen yet but would be really nice as boolean parameter for setValue.
Steffen Raubvogel: Haven't seen yet but would be really nice as boolean parameter for setValue.
actually there is one in AbstractField.class : protected void setValue(Object newValue, boolean repaintIsNotNeeded), but as you can see it's protected, and parameter by default is false! i've tried setting many parameters like setVisile, setEnable, setWriteThrough, but that's was in vain(
Sinaver Idrisov:
actually there is one in AbstractField.class : protected void setValue(Object newValue, boolean repaintIsNotNeeded), but as you can see it's protected, and parameter by default is false! i've tried setting many parameters like setVisile, setEnable, setWriteThrough, but that's was in vain(
repaintIsNotNeeded is different from firing the value change event. If you take a look into the AbstractField.setValue method you see that the value change event is always fired. I think this is a general decision of the framework and if you don't want to be notified for a specific setValue call then you should - as you mentioned already - remove listener or set an internal variable for this.
Steffen Raubvogel:
Sinaver Idrisov:
actually there is one in AbstractField.class : protected void setValue(Object newValue, boolean repaintIsNotNeeded), but as you can see it's protected, and parameter by default is false! i've tried setting many parameters like setVisile, setEnable, setWriteThrough, but that's was in vain(repaintIsNotNeeded is different from firing the value change event. If you take a look into the AbstractField.setValue method you see that the value change event is always fired. I think this is a general decision of the framework and if you don't want to be notified for a specific setValue call then you should - as you mentioned already - remove listener or set an internal variable for this.
Yeah, you're right, my bad( Now, what i've done : implemented an boolean flag inside event, that permits or prohibits execution of inside code, kind of Kludge, but i have no other option.