I'm trying to compare the value of a property to a String using isEqualsTo. This value always returns true, regardless of the string I'm comparing the property to. I have a model that has a messageType, this message type is a string and it could be CLOSED or WARNING.
I have the following model:
class MessageModel {
@FXObservable String messageType
}
This is my view
MessageModel model
String CLOSED = 'CLOSED'
String WARNING = 'WARNING'
if (model.messageTypeProperty().isEqualTo(CLOSED)) {
image.setImage(new Image("/com/pppp/ddd/img/messageLock.png"))
} else if (model.messageTypeProperty().isEqualTo(WARNING)) {
image.setImage(new Image("/com/pppp/ddd/img/messageWarning.png"))
}
This doesn't work, it always returns true on the first IF.
Any help would be appreciated!