BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-12-2008, 12:33 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: 8800
PIN: N/A
Carrier: simulator
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Listfield removeAllElements uncaught exception 14 >= 14

Please Login to Remove!

hi Guys,

i'm create ListField with dynamic data, and after i refresh the list, using removeAllElements, there is a warning "uncaught exception 14 >= 14", did i missed something ?
Offline  
Old 11-12-2008, 03:58 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I cannot find "removeAllElements()" in the ListField API
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 11-13-2008, 11:56 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: 8800
PIN: N/A
Carrier: simulator
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Ivanov,

What should i used to remove old data in listfield?
Offline  
Old 11-17-2008, 06:01 AM   #4 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default

ListField.invalidate()
__________________
having new s for developers!!!
Offline  
Old 11-21-2008, 11:44 PM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: 8800
PIN: N/A
Carrier: simulator
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Vector listElements = new Vector();

actually, i'm using

public Vector listElements = new Vector();

to insert new item,

any solutions to remove all elemets in Vector?
Offline  
Old 11-24-2008, 03:58 AM   #6 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
    public void add(Object element) {
        _listElements.addElement(element);
        setSize(getSize());
    }

    public int getSize() {
        return (listElements != null) ? listElements.size() : 0;
    }
    
    public void remove(int index) {
        listElements.removeElementAt(index);
        setSize(getSize());
    }
    public void removeAll() {
        listElements.removeAllElements();
        setSize(0);
    }
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 11-25-2008, 02:54 AM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2008
Model: 8800
PIN: N/A
Carrier: simulator
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You're the best, Ivanov...

when i add setSize(0); the ListElements refreshed and filled with new list.

Thanks again...
Offline  
Old 01-31-2009, 02:51 AM   #8 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2008
Model: 8800
PIN: N/A
Carrier: AT
Posts: 81
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Do you know how to select particular row in the ,i tried setSelectedIndex method of ListField but it doesn't work,
Any idea to select the particular row.
Offline  
Old 02-02-2009, 04:13 AM   #9 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

setSelectedIndex works, but only if the listfield has the focus
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
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





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