Join Our 3 MILLION+ Members Today! Register Here | Login
Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > App Developers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
    Thread Author   #1  
Old 01-02-2012, 07:44 AM
CrackBerry Newbie
 
Join Date: May 2011
Posts: 7
Likes Received: 0
Thanked 0 Times in 0 Posts
Default Custom listfield item click

Hi All,

I have created one custom list field. For each row I have 4 bitmaps. I have used graphics.drawBitmap method to draw all bitmaps. Actually I need to do separate action for each bitmap click. Pls help me in this regard with sample src.

Thanks in advance,
Saranya
Reply With Quote Tip this Post
  #2  
Old 01-03-2012, 11:23 PM
Developer - ToySoft
Device(s): 9800 (Torch)
Carrier: Fido
 
Location: Canada
Join Date: May 2008
Posts: 2,756
Likes Received: 48
Thanked 80 Times in 54 Posts
Default

add this to your class

public boolean navigationClick(int status, int time) {

// index will contain 0 to x when the users clicks on the list

int index = your_list_variable.getSelectedIndex();

if (index == 0)
{
// bitmap one selected
}
else
if (index ==1 )
{
// bitmap 2 selected
}

// return true cuz we already handled this event

return true;
}
__________________
Visit our website www.toysoft.ca for Cool BlackBerry Apps!
Follow us @ http://twitter.com/toysoft or visit us at AppWorld
Reply With Quote Tip this Post
    Thread Author   #3  
Old 01-07-2012, 01:05 AM
CrackBerry Newbie
 
Join Date: May 2011
Posts: 7
Likes Received: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your reply. But your solution is for each row selection. If first row is selected the selection index will be 0. So we will take action according to it.

But I need to navigate within a row. One list row having 4 bitmaps. Focus should move from one bitmap to another. And while clicking on one of them , particular action need to be done. how to handle that case? how to move focus within a row? And handling navigation click for each one of them. Pls suggest.


Thanks in advance,
Saranya
Reply With Quote Tip this Post
  #4  
Old 01-09-2012, 12:42 AM
Developer - ToySoft
Device(s): 9800 (Torch)
Carrier: Fido
 
Location: Canada
Join Date: May 2008
Posts: 2,756
Likes Received: 48
Thanked 80 Times in 54 Posts
Default

when you add the list to the window the moving and highlighting is all done by the OS and you do not need to do anything.

if use scroll the list up and down the code will not do anything until you click on.
__________________
Visit our website www.toysoft.ca for Cool BlackBerry Apps!
Follow us @ http://twitter.com/toysoft or visit us at AppWorld
Reply With Quote Tip this Post
Reply
BlackBerry Forums at CrackBerry.com > > BlackBerry Professionals > App Developers   Custom listfield item click

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes