Hi . First of all, excuse my bad English . I will do my best so that you can understand me.
I am here for the reason of finding a way to sort items in the combobox already loaded once and add a new item .
To give you an idea. In my project I have a combobox that when loaded the XHTML, load the combobox with data from a database ( the database give to me the data sorted alphabetically ) . In addition , I add dynamically new data are added to the database and I update the combobox , so that this new data would be accessible.
The easiest way to do it is every time I add the new data to the database, I clean the combobox back to charge all data sorted alphabetically and thus ordered the new data appear .
But imagine to have 1,000,000 load data. These will be loaded each time you add an item . Will slightly slow the page. So I wonder if there is a way to insert the item so ordered alphabetically . Why? . It’s simple:
I can add the new data to the database . If the database tells me that the load was successful, only add the new data to the combobox inserted alphabetically ordered and would not have to clean the combobox and load the last 1,000,000 data I loaded before .
I hope I implied . If I do not explain correctly, I could explain otherwise.