Hi, I am using UiBooster by Milchreis. I am having an issue with calling a function using .addbutton() . Relevant code is below; I am getting error “unexpected token: )” on the addButton() to the routine , ()->sendData(). I am guessing I am missing a pointer of some kind?
new UiBooster()
.createForm(" Brewery Recipe settings ")
.addText("Strike Water Temp: ")
.addText("Mash Temp: ")
.addText("Mash time: ")
.addText("Mash Out Temp: ")
.addText("Mash Out time: ")
.addText("Sparge Time: ")
.addText("Total Boil Time: ")
.addText("Hop Timing, e.g. 0,30,60: ")
.addButton("Send Data to Brewery", ()->sendData())
.setChangeListener(new FormElementChangeListener() {
public void onChange(FormElement element, Object value) {
if(element.getIndex() == 0) {
StrikeWaterTemp = element.asString();
}
if(element.getIndex() == 1) {
MashTemp = element.asString();
}
if(element.getIndex() == 2) {
MashTime = element.asString();
}
if(element.getIndex() == 3) {
MashOutTemp = element.asString();
}
if(element.getIndex() == 4) {
MashOutTime = element.asString();
}
if(element.getIndex() == 5) {
SpargeTime = element.asString();
}
if(element.getIndex() == 6) {
BoilTime = element.asString();
}
if(element.getIndex() == 7) {
HopSchedule = element.asString();
}
}
})
.run();
void sendData() {
println("About to send data to controller");
}