BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 05-18-2009, 09:19 AM   #1 (permalink)
New Member
 
Join Date: Jun 2008
Model: 8707
PIN: N/A
Carrier: Vodafone
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question How to get ListField selected Item ClickEvent

Please Login to Remove!

Hi,

I am newbei for the ListItem in Blackberry.
I have no. of items in the ListField which i have Drawn using the ListFieldCallBack method.
Now whenever i m rendering on any item in the ListField ,How should i get the clickevent and how should i put the other code on that selected item.

Please provide any code or any solution or any useful link as i m in very urgent in need . pls see my code snippet below.

{code}
public void drawListRow(ListField list, Graphics g, int index, int y,
int w) {



Field fld=null;
try {
if (index == list.getSelectedIndex()) {

}

try {
objBitmap1 = Bitmap.getBitmapResource("1y.png");
g.drawBitmap(0, y, objBitmap1.getWidth(),
objBitmap1.getHeight(), objBitmap1, 0, 0);
} catch (Exception e) {

// }
}
} else {

objBitmap = Bitmap.getBitmapResource("1.png");
g.drawBitmap(0, y, objBitmap.getWidth(), objBitmap
.getHeight(), objBitmap, 0, 0);

}
}catch(Exception e){

}
g.drawText("Test",0,y,0,255);
try{
//Dialog.alert("index ::"+Integer.toString(index));
}catch(Exception e){
}
g.drawText(String.valueOf(index * 111), 0, 0, DrawStyle.RIGHT, 100);
}

public Object get(ListField listField, int index) {
// Dialog.alert(Integer.toString(index));
return null;
}

public int getPreferredWidth(ListField listField) {
return Graphics.getScreenWidth();
}

public int indexOfList(ListField listField, String prefix, int start) {
Dialog
.alert(Integer.toString(listField
.indexOfList(prefix, start)));
return listField.indexOfList(prefix, start);
}


{/code}


Thanks in Advance

Regards,
Mishal
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

OMRON SYSMAC PLC CS1G CPU 43-V1 with new battery
$69.0
 OMRON SYSMAC PLC CS1G CPU 43-V1  with new battery picture3 each Ando AQ6317x Optical Spectrum Analyzer Boards; CPU / Driver
$1599.99
3 each Ando AQ6317x Optical Spectrum Analyzer Boards; CPU / Driver pictureAllen Bradley 1756-L55M12 -L55 -M12 Ser A ControlLogix Logix5555 Processor UNOB
$95.24
Allen Bradley 1756-L55M12 -L55 -M12 Ser A ControlLogix Logix5555 Processor UNOB pictureOmron ZEN 10C1AR-A-V1 Programmable Relay PLC CPU unit ZEN-8EAR I/O card UNOB
$67.46
Omron ZEN 10C1AR-A-V1 Programmable Relay PLC CPU unit ZEN-8EAR I/O card UNOB pictureAXIOMTEK SBC81825VE SBC81825VE with CPU memory fan, USED
$130.0
AXIOMTEK SBC81825VE SBC81825VE with CPU memory fan, USED picture






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