The list boxes have predefined formats to display data and the datainput is given according to those formats and are displayed. Suppose if we want to add more columns and store user data in the list but they need not be displayed.
We can achieve this by creating an array list and store the all the data entries in the array list. When the array list is passed to the listbox model it reads the data corresponding to its own format and rest of the data would not be displayed (remain invisible). But still the invisible data can be retrieved by accessing the array list since it is stored there.
The CAknSingleGraphicStyleListBox list box has the following format:
where:
We create an array list with these four columns and pass it to the listbox model.
If the input data for row1 is ICON1, USERDATA1, ICON2, ICON3 respectively, then the data displayed in the CAknSingleGraphicStyleListBox would be
For the same array list two more columns can be added, for example USERDATA2 and USERDATA3
The input data for the list box would now be ICON1, USERDATA1, ICON2, ICON3, USERDATA2,USERDATA3 and the output displayed in the CAknSingleGraphicStyleListBox would still be
But the values of the invisible data USERDATA2 and USERDATA3 can be retrieved since they are being stored in the item array list.
Related Links:
http://wiki.forum.nokia.com/index.php/Image:ListBox_ModelEx_bkp.zip
No related wiki articles found