Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 33
Registered: ‎04-25-2009
My Device: Not Specified

Customizing KeywordFilterField

[ Edited ]

I essentialy want to convert an exisiting customized listfield to being a KeywordFilterField.

public void drawListRow(ListField listField, Graphics graphics, int index, int y, int width)
{
XYRect redrawRect = graphics.getClippingRect();
graphics.setFont(Font.getDefault( ).derive( Font.ANTIALIAS_SUBPIXEL, 15 ));
String text = (String)listElements.elementAt(index);


if(listField.getSelectedIndex() == index)
{

[...]

} else
{
[...]
}
}

 

 

 The Problem is this part, which leads to an ArrayOfIndex Exception

 

String text = (String)listElements.elementAt(index);

 

 When I fill out the Source List of the KeywordFilterField by using

 

 

_ContactList.setSourceList(listContactFavorites, listContactFavorites);

 

The listElements I want to access to draw my text isn't set the Source List. 

 

What's the best way to access the SourceList in my DrawListRow Function?!

 

Thanks!

 

 

 

Message Edited by hhessel on 07-10-2009 05:30 AM
Message Edited by hhessel on 07-10-2009 05:33 AM
Message Edited by hhessel on 07-10-2009 05:33 AM