How to trigger property invalidation?

Pavel Safrata pavel.safrata at oracle.com
Fri Nov 2 07:50:56 PDT 2012


Hi Werner,
I think that you cannot trigger invalidation manually by design. The 
property holds a reference and should not be concerned with changes of 
anything else than the reference. There would be various issues with it, 
for example there are change notifications bound to the invalidation, 
which would produce a weird notification of the property being changed 
to the same value. I think the right approach is to listen directly on 
the myProperty instead of tweaking the invalidation mechanism.

With Regards,
Pavel

On 2.11.2012 12:55, Werner Lehmann wrote:
> Hi,
>
> for an ObjectProperty<MyBean>, is it possible to trigger invalidation 
> manually when MyBean.myProperty changes? Basically I'd like to call 
> markInvalid() but it is private. And set() compares old and new value 
> by reference before invalidating, so won't see the change either.
>
> Workaround seems to be to copy the bean to another instance and assign 
> the new instance to the object property.
>
> Rgds
> Werner



More information about the openjfx-dev mailing list