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

Fire-lite FC-AAM25X 25 WATT FIRE ALARM VOICE EVACUATION AMPLIFIER
$199.0
Fire-lite FC-AAM25X 25 WATT FIRE ALARM VOICE EVACUATION AMPLIFIER pictureHONEYWELL R7847B1031 AMPLIFIER *NEW NO BOX*
$134.0
HONEYWELL R7847B1031 AMPLIFIER *NEW NO BOX* pictureFanuc Servo AMPLIFIER A06B-6100-H001 Mother BOARD A20B-2002-071 parts OR repair
$89.99
Fanuc Servo AMPLIFIER A06B-6100-H001 Mother BOARD A20B-2002-071 parts OR repair  pictureAllen Bradley 1394-SJT10-C-RL 10kw System Module, Auction No Reserve
$1.0
Allen Bradley 1394-SJT10-C-RL 10kw System Module, Auction No Reserve  pictureGAI-TRONICS 7245-002 PAGE/PARTY SYSTEM AMPLIFIER ENCLOSURE
$14.95
GAI-TRONICS 7245-002 PAGE/PARTY SYSTEM AMPLIFIER ENCLOSURE picture






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