-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SuppplierOrder #37
SuppplierOrder #37
Conversation
…lierOrdersServiceImpl + SupplierOrdersController +SupplierOrdersView
src/main/java/org/chainoptim/desktop/features/client/controller/ClientOrdersController.java
Outdated
Show resolved
Hide resolved
quantityColumn.setCellFactory(TextFieldTableCell.forTableColumn(new FloatStringConverter())); | ||
statusColumn.setCellFactory(TextFieldTableCell.forTableColumn()); | ||
|
||
tableView.setMaxHeight(Double.MAX_VALUE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should identify the configuration that can be taken out of here and reused for the other tables we'll have, perhaps through a static method of a util class.
src/main/java/org/chainoptim/desktop/features/client/controller/ClientOrdersController.java
Show resolved
Hide resolved
src/main/java/org/chainoptim/desktop/features/client/controller/ClientOrdersController.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
private void setEditEvents() { | ||
clientIdColumn.setOnEditCommit(event -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generialize this setOnEditCommit block to not repeat yourself. But more importantly, do not go to the database for every edited value, there should be a save button somewhere (perhaps restricting to updating one order at a time).
|
||
private void updateInDatabase(ClientOrder order) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the update service method and use it here to update. I'll add a Toast system later for confirming successful operation/signaling error.
I created the table for SupplierOrders. Unlike the table in ClientOrders, I've incorporated a TableView into a StackPane instead of a ScrollPane and haven't noticed any difference; if necessary, StackPane automatically creates its scrollbar. We'll see which option is better once we implement pagination. I still have some minor adjustments to make (for example, fetching the order status).