how to refresh a TableView after inserting a record in the database?
Let me explain:
when the program is loaded the Tableview view correct record of a database, but when insert a new record into db and reload with:
Tableview probably will not be updated because the program crashes, this is log:
If I close and reopen the program, the record, however, has been included
If you omit this line:
after DBUtils.InsertMaps(SQL1, "Gruppi", lista), the program not crashes
Let me explain:
when the program is loaded the Tableview view correct record of a database, but when insert a new record into db and reload with:
B4X:
DBUtils.InsertMaps(SQL1, "Gruppi", lista)
'Now reload db <Gruppi>
DBUtils.ExecuteTableView(SQL1, "SELECT * FROM Gruppi", Null, 0, tablearcdb)
Tableview probably will not be updated because the program crashes, this is log:
B4X:
InsertMaps (first query out of 1): INSERT INTO [Gruppi] ([Id], [N_Gruppo], [Ip], [Nome_Gruppo]) VALUES (?, ?, ?, ?)
java.lang.StackOverflowError
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1108)
at com.sun.javafx.css.StyleManager$StylesheetContainer.getStyleHelper(StyleManager.java:1182)
at com.sun.javafx.css.StyleManager$StylesheetContainer.access$1300(StyleManager.java:1039)
at com.sun.javafx.css.StyleManager.getStyleHelper(StyleManager.java:976)
at javafx.scene.Node.impl_createStyleHelper(Node.java:7437)
at javafx.scene.Node.impl_processCSS(Node.java:7407)
ecc......
If I close and reopen the program, the record, however, has been included
If you omit this line:
B4X:
DBUtils.ExecuteTableView(SQL1, "SELECT * FROM Gruppi", Null, 0, tablearcdb)