I built an application to scan items in our inventory and do the annual counting... Works great, on the computer. The aim is to have it on one of our surface 4 pro
and run around with the barcode scanner and input the quantities. Works fine
As the app runs locally (wifi coverage too poor), storing data in SQLite, I have methods to sync the MySQL server. Works fine! But...
As every app, everything is closed controlled, and I use the official Alert dialogs to display the different confirmations/informations/errors
. They don't respond to touch events! If I use a mouse, I can nicely click the buttons, but impossible to click them by touching!
As an example of a dialog:
public void syncServer() {
final Alert confirmation = new Alert(Alert.AlertType.CONFIRMATION);
confirmation.setTitle("Confirmation requise");
confirmation.setHeaderText("Synchroniser avec le serveur");
confirmation.setContentText("Voulez-vous envoyer les données au serveur? Attention, cette action remplacera l'entier des données distantes par vos données locales!!");
confirmation.initOwner(getPrimaryStage());
Optional<ButtonType> result = confirmation.showAndWait();
if (result.isPresent() && result.get() == ButtonType.OK) {
if (Mysql.getInstance().init(this)) {
...
}
}
}
This alert typically shows a dialog of type confirmation with two button, OK and cancel. None of them react to touch events...
Anybody already had that and could solve it?
Looking a bit further on Stackoverflow, well, 2 questions about it, one using custom dialogs and adding listeners to custom buttons... It's a bit of a hassle to implement custom buttons for each and every dialog in the app...