BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 03-31-2009, 02:07 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default setting row height in ObjectListField

Please Login to Remove!

Hi,
i have got a problem by setting the row height in a ObjectListField.
After i create a new instacne of an ObjectListField I set the row height by this code line:
Code:
 c = new ListField();     
c.setRowHeight(75);
callback = new ListCallback();
c.setCallback(callback);
but th height is always the same, so I take a look at the callback:
Code:
public class ListCallback extends ObjectListField implements ListFieldCallback{
 private Vector listElements = new Vector();
 public void drawListRow(ListField list, Graphics g, int index, int y,int w) {
  String text = (String)listElements.elementAt(index);
  setRowHeight(index,75);
   //...
And now the row height has changed. Great !!

But now I want to do this on BlackBerry 8900 with Java 4.6, and there I get an error (at red line) while adding some new Items to my ObjectListField:
Code:
public void updateList(String _view, boolean _init) {     
        Vector vDummy = loadData();        
        DataList.removeAllElements();
        for (int i = 0; i < vDummy.size(); i++) DataList.addElement(vDummy.elementAt(i));
    
        UiApplication.getUiApplication().invokeLater(new Runnable(){  
            public void run() {
                        try {
                            // liste leeren
                            while(c.getSize() > 0) {
                                c.delete(0);
                                callback.listElements.removeElementAt(0);
                            } 
                           
                            for(int i = 0; i < DataList.size(); i++) {
                                    c.insert(i);
                                    callback.insert("",i);
                            }
                            c.invalidate();
So the list seams to be blank. So how do I change the row height? Is there an easier way, maybe??

thanks hibbert
__________________
My English is so bad, that makes me nobody so quickly after
Offline  
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

Fanuc A16B-3200-0500 I/O board for the 0i-B / zero iB control system
$950.0
 Fanuc A16B-3200-0500 I/O board for the 0i-B / zero iB control system picture1 Used Fanuc A20B-3300-0293 486 CPU MODULE W16 MEG DRAM
$599.0
1 Used Fanuc A20B-3300-0293 486 CPU MODULE W16 MEG DRAM picture1pcs Used A20B-2003-0490 2 SLOT BACK PANEL PCB
$950.0
1pcs Used A20B-2003-0490 2 SLOT BACK PANEL PCB  pictureNew FANUC A16B-2203-0881
$699.0
New  FANUC A16B-2203-0881  pictureFanuc PC BOARD F0I-B MAIN CPU A16B-3200-0491
$1599.0
Fanuc PC BOARD F0I-B MAIN CPU A16B-3200-0491 picture






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