+ 1
Help
Hey, guys, someone knows how to get a data table from a database into a combobox. That's the first part, the second part would be how to make it so that when you select an item from the combobox it sends you another data from the same table but to a textfield. This is all in java. For example I have a database of a product, so it's id, name, price. The name is the one that will be sent to the combo and the price to the textfield and it will change every time the item changes. I hope you got my drift.
1 Answer
0
There are a lot of implementations for this based on the requirement. If the dataset is small like less than a 100 and mostly doesn't change, you can just pull all the data from the database and the handle all the requirements in JavaScript. If the dataset is large or it changes frequently, you should use a search field for the Product name, which will try to auto complete as you type a few characters (get id and name for search, the name is to display the contents for autocomplete and id to use for part 2)and once the product name is selected, then send the id to the back end to get the product details and populate the product price. Hope it helps