Skip to content
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

Merged
merged 8 commits into from
Mar 26, 2024
Merged

SuppplierOrder #37

merged 8 commits into from
Mar 26, 2024

Conversation

SorinPopteanu
Copy link
Owner

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).

quantityColumn.setCellFactory(TextFieldTableCell.forTableColumn(new FloatStringConverter()));
statusColumn.setCellFactory(TextFieldTableCell.forTableColumn());

tableView.setMaxHeight(Double.MAX_VALUE);
Copy link
Collaborator

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.

}

private void setEditEvents() {
clientIdColumn.setOnEditCommit(event -> {
Copy link
Collaborator

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) {
Copy link
Collaborator

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.

src/main/resources/css/scrollbar.css Show resolved Hide resolved
@TudorOrban TudorOrban merged commit 140c50d into main Mar 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants