0

I am making my first application for BlackBerry (OS 6.0+) and I have to define a screen like in the image below. I have read about RichList but its not allowed to be added below the other components.

What I'm trying to achieve

What I want is the part (list) below the wide ButtonField. The white boxes should contain images and the scribbles in front of it should contain text. This "list items" are populated dynamically.

As you can see, this very-much resembles the layout of a RichList, but I can't seem to add it to the VerticalFieldManager that I have used as the main container of components.

So if anyone can help me get this screen, I'm really grateful! Thanks in advance.

Michael Donohue
  • 11,776
  • 5
  • 31
  • 44
Roshnal
  • 1,284
  • 3
  • 16
  • 39
  • What about using `ListField`? You can check this answer: http://stackoverflow.com/a/1881319/431639 – Rupak Mar 14 '12 at 06:52
  • @Rupak I checked it out.. But is there any efficient way of doing that? ('cos this application may have large number of rows). If I get no satisfactory answer, then I'll resolve to doing that. – Roshnal Mar 14 '12 at 07:02
  • Not sure about the efficiency in case of large lists, but it is much more efficient and effective than using customized `VerticalFieldManager` which will contain the row items. Also it is possible to populate the list with new items and delete items from the list dynamically using the current selected row information. So I think this can be used with some dynamic data erasing/adding. – Rupak Mar 14 '12 at 07:50
  • @Rupak OK, thanks for the link and tips.. Ravi's answer is also good, so I'll check both of them out. But I'll select Ravi's answer as the correct one. – Roshnal Mar 14 '12 at 08:21

1 Answers1

2

You need to implement ListFieldCallback and overwrite all methods. There you will see "drawListRow" method. You need to draw Images on left and text on write on this method index wise. like this:-

    ListData ld = (ListData) rows.elementAt(index);

             g.drawText(ld.name,  30+extraSpaceDelete, y
            + (listItemHeight - g.getFont().getHeight()) / 2);

    g.drawText(ld.address,  30+extraSpaceDelete, (y
            + (listItemHeight - g.getFont().getHeight()) / 2)+(g.getFont().getAscent()+10));

    g.drawBitmap(0, y + listItemH - 3, Display.getWidth(), 3,
            separator_line, 0, 0);
Ravi Soni
  • 36
  • 2