How can I filter items in a Listbox?
| Thu, 2005-06-23 14:09 | |
|
|
Hi All! I am trying to make a ListBox with a FindBox. I find only one useful class: CCknSearchField. I know how can I make and use a Findbox in Series60, but in Series80 I can not find equivalence classes for these:
AknFind::HandleFindOfferKeyEventL CAknListBoxFilterItems -> No direct mapping. CAknFilteredTextListBoxModel -> No direct mapping. Please help. Regards, RadeaR |






Forum posts: 192
theArray->Sort();
theListBox->HandleItemAdditionL();
Forum posts: 2
You can use the following code snippet to get the original unfiltered index from a list in series 80
TInt index = iList->CurrentItemIndex();
// this gives the index of the filtered list
CTextListBoxModel *model = iList->Model();
TPtrC displayedData = model->ItemText(index);
//to get the original index
MDesCArray *elements = model->ItemTextArray();
CDesCArray *itemArray = STATIC_CAST( CDesCArray*, elements );
TInt originalIndex;
itemArray->Find(displayedData, originalIndex);
return originalIndex;
originalIndex gives the unfiltered index of the currently selected item in the filtered list
Njoy !!
As for direct mapping for AknFind::HandleFindOfferKeyEventL,
you can use iSearchField->OfferKeyEventL()