BlackBerry Forums Support Community               

Closed Thread
LinkBack Thread Tools
Old 03-16-2010, 04:33 AM   #1 (permalink)
New Member
Join Date: Feb 2010
Model: 9500
Carrier: NA
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default facing problem using KeywordFilterField example

Please Login to Remove!

Hello All,

I am trying to make a searchable list where each entry can include multiple lines and sometimes an image. I have done this by using ListFieldCallback.

Now I am facing the problem in sorting the list. My code is as follows

MyListFieldCallback listCallback = new MyListFieldCallback();


_keywordFilterField.setSourceList(_countryList, _countryList);

The code of the MyListFieldCallback is the following:

public class MyListFieldCallback implements ListFieldCallback {
Vector _listData = new Vector();
public Vector get_listData() {
return _listData;

public void set_listData( Vector data ) {
_listData = data;

public void drawListRow( ListField listField, Graphics graphics, int index, int y, int width ) {
int defalutColor = graphics.getColor();
Object currentRow = this.get(listField, index);
if ( null != currentRow ) {
// Between each row a line is drawn
graphics.drawRect(0, y, width, listField.getHeight());
graphics.drawText(((Country)currentRow).get_countr yName(), 0, y, Graphics.ELLIPSIS, Display.getWidth()/2);
graphics.drawText(((Country)currentRow).getCapital City(), Display.getWidth()/2, y, Graphics.ELLIPSIS, Display.getWidth()/2);

public Object get( ListField listField, int index ) {
return _listData.elementAt(index);


public int getPreferredWidth( ListField listField ) {
// TODO Auto-generated method stub
return 0;

public int indexOfList( ListField listField, String prefix, int start ) {
// TODO Auto-generated method stub
return 0;


I think selection i.e the list used by drawListRow is not the sorted one.

Can anyone help me

Thanks in advance
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Honeywell Ultraviolet Flame Amplifier
Honeywell Ultraviolet Flame Amplifier pictureC98040-A7007-C1-01 C98043-A7007-L1 SIEMENS
C98040-A7007-C1-01 C98043-A7007-L1 SIEMENS pictureLOT 2X C98040-A7007-C1-01 C98043-A7007-L1 SIEMENS
LOT 2X C98040-A7007-C1-01 C98043-A7007-L1 SIEMENS pictureAllen Bradley Ultra 3000, Digital Servo Drive, 2098-DSD-010-SE
Allen Bradley Ultra 3000, Digital Servo Drive, 2098-DSD-010-SE pictureReliance Electric Electro-Craft Motomatic II SC Servo Amplifier 9078-0120
Reliance Electric Electro-Craft Motomatic II SC Servo Amplifier 9078-0120 picture

Copyright 2004-2016
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.