This is a question about proper way of doing things with listboxes. I know how to add and remove items to/from a listbox, but what escapes me is how to actually accomplish something practical with it in practical way.
Lets say I have a database that I use to create a CDesCArrayFlat of descriptors and hand that to listbox model with SetItemTextArray.
Now I have a listbox that shows what is in the database, and I can select items from the listbox, but the only data I can get from the selected item is the index number in the listbox and the descriptor of of the item. Neither of those is directly usable, if I, for example, wanted to delete the selected item from the database.
What I would like to do is stuff something like database row id's into the listbox model together with the descriptor array, so that I could map a selected item in the listbox to a specific database row. It's easy to implement that myself by just having a separate array of database row id's. But that seems like something the framework should do. Maybe I just haven't programmed symbian long enough. :-)
I would assume that this is what some of the ListBoxModel classes are for, but I didn't even find a way to point listbox to use self defined ListBoxModel.
Could somebody explain (or link to a good example code/document) how lisboxes ListBoxModels are supposed to be used outside tutorials.