Tornadofx: Using the enableWhen(...) method

Created on 1 Dec 2017  路  2Comments  路  Source: edvin/tornadofx

Hello, I would like to know if the method enableWhen(...) can be used in this type of case:

button{
   enableWhen({indexNavigation > 0})
}

How could I do it to make it work?

Most helpful comment

Hey @TioCoding if the indexNavigation anything that extends NumberProperty you can simply do:

button {
   enableWhen(indexNavigation.greaterThan(0))
}

This will enable the Button everytime it is greater 0.
Here is the JavaDoc for the greaterThan

All 2 comments

Hey @TioCoding if the indexNavigation anything that extends NumberProperty you can simply do:

button {
   enableWhen(indexNavigation.greaterThan(0))
}

This will enable the Button everytime it is greater 0.
Here is the JavaDoc for the greaterThan

Thank you very much @nimakro , this served me a lot. :smile:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spkingr picture spkingr  路  4Comments

elliotcm picture elliotcm  路  7Comments

jagiellonczyk14 picture jagiellonczyk14  路  6Comments

AlbRoehm picture AlbRoehm  路  3Comments

arslancharyev31 picture arslancharyev31  路  7Comments