B4J Question Tableview add delete sum

roberto64

Active Member
Licensed User
Longtime 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

  • Esempio.zip
    3.2 KB · Views: 187

klaus

Expert
Licensed User
Longtime 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

  • Esempio1.zip
    3.3 KB · Views: 191
Upvote 0

roberto64

Active Member
Licensed User
Longtime 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
 
Upvote 0

roberto64

Active Member
Licensed User
Longtime 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
 
Upvote 0

klaus

Expert
Licensed User
Longtime 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

  • Esempio2.zip
    3.4 KB · Views: 163
Upvote 0

roberto64

Active Member
Licensed User
Longtime 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
 
Upvote 0

roberto64

Active Member
Licensed User
Longtime 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

  • Tabview_risultato.zip
    129.4 KB · Views: 168
Upvote 0
Top