@Override
public void onPOSTComplete(String data, OgemaHttpRequest req) {
FloatResource source = getResource(sva, req, FloatResource.class);
String val = myField.getValue(req);
float value;
try {
value = Float.parseFloat(val);
} catch (NumberFormatException | NullPointerException e) {
if(alert != null) alert.showAlert(notAllowedMessageUsed, false, req);
return;
}
if (value < minimumAllowed) {
if(alert != null) alert.showAlert(notAllowedMessageUsed, false, req);
return;
}
if (value > maximumAllowed) {
if(alert != null) alert.showAlert(notAllowedMessageUsed, false, req);
return;
}
if(!source.exists()) {
source.create();
setValue(source, value);
source.activate(true);
} else {
setValue(source, value);
}
if(alert != null) alert.showAlert("New value: " + value, true, req);
}