The implementation of these listeners is backwards. It should be the change in the model state which triggers the change in the visible state, not a listener to a visibility change which applies a change to the model.