Forum Discussion

Holly_Greger's avatar
Holly_Greger
Contributor
15 years ago

A button's action listener is ignoring the defined closure

Hello,

I am building a simple interface where i have a button whose action's closure never seems to get executed no matter what i do. I try the exact same code in a stand alone groovy console and it executes fine. I'm thinking SoapUI is the problem here. My code is the following.


swing = new SwingBuilder()

retrieveAction = swing.action(name:'Retrieve', closure:{ event ->
log.info "Retrieve Button Clicked!"
}, enabled:true)

frame = swing.frame(title:'Update Contact', size:[525,900], layout: new BL(), resizable:true){
scrollPane(){
panel{
tableLayout{
tr{
td(align:'CENTER',colspan:2){
panel(background:Color.RED){
button(action: retrieveAction)
}
}
}
...


something interesting is the fact that my button receives its name from the action and am also able to disable it through the action as well so it's mapping to it with no problem but when the button is clicked the closure never gets called. Let me reiterate that this works just fine on a groovy console but not SoapUI. Any insight in this issue will be greatly appreciated.
No RepliesBe the first to reply