I'm using Griffon 1.5 .. In a view I have a panel defined as ..
panel(background: bind { model.background },
visible: bind { model.stillageComplete },
constraints: 'grow,wrap') {
migLayout(layoutConstraints:'fill')
label(text: bind{model.stateText}, constraints:'align center', foreground: bind{model.foreground},
font: new Font("Sans Serif", Font.BOLD, 20))
}
and in a model I have ..
@Bindable
@PropertyListener(stillageCompleteCheck)
boolean toggle
@Bindable
stillageComplete = false
@Bindable
stateText
.. along with other fields and the property listener method ..
private stillageCompleteCheck = { evt ->
def contentsChecked = checkContents()
stillageComplete =
(currentContentCount == stillageSize && !(statusList.find { it != Color.green })
println "StillageComplete ? ${stillageComplete} ${currentContentCount} ${stillageSize}"
println "StateText ? ${stateText}"
}
I set the model.toggle variable in a controller method which runs the propertyListener code and correctly sets the parameters BUT the panel IS NOT displayed .. Can anyone see a problem with my code ?
As an aside .. I have another panel as below which works without problem ..
panel(background: Color.yellow,
visible: bind { model.stillageOverdue },
constraints: 'grow,wrap') {
migLayout(layoutConstraints: 'fill')
label("Finish Time Overdue", constraints: 'align center', foreground: Color.red,
font: new Font("Sans Serif", Font.BOLD, 20))
}