B4J Question Tableview add delete sum

roberto64

Active Member
Licensed User
Hello, I'm doing a tableview that inside there are two combo boxes, two text fields and a label, as an example that I include, in fact when I enter qty and price (qty * price) makes me the total in the label ( total), when I enter the second line in the tableview and enter the quantity and the price is fine, but when I change the price or the amount the total changes in the second line. who can help me?
Greetings
 

Attachments

klaus

Expert
Licensed User
The problem is that when you change the row TxtQuantita and TxtTotale are previous ones.
You need to get these objects from the list for the given row.
Attached a modified version.

Why do you use WrapLabel? Putting a Label on top of an AnchorPane?
 

Attachments

roberto64

Active Member
Licensed User
thanks for your availability, you ask me why you use WrapLabel, I found this example in the forum, because I wanted to put the total right, if a suggestion you are happy to take note.
regards
 

roberto64

Active Member
Licensed User
hello Klaus, on the text everything ok, but on the comboboxes equally if I insert the second line and then I go in the first line I always load the last one inserted. thank you
 

klaus

Expert
Licensed User
My question about WrapLabel was due to my ignorance about TableView usage as I have almost never used it.
Now I know why.

For the ComboBoxes the principle is the same as for the TextFields and the Label.
You need to get the ComboBox of the right row.
Attached a modified version with one of the ComboBoxes.
 

Attachments

roberto64

Active Member
Licensed User
Hello Klaus, I understood how to see the value of the combox, but what I can not do and to select the first combobox "the one with the description" once selected in the combobox "description5" I must load the combo gauge with item .
thanks for your time
 

roberto64

Active Member
Licensed User
As per file, opening the combobox and selecting Description5 instead of opening the combobox in the same row loads the combobox of the second line.
thank you
 

Attachments

Top