BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 01-09-2008, 06:24 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Click event in Label

Please Login to Remove!

hi

in my application i want to add a label which will have the click event. i tried to make the customButtonField, but in that the button looks still comes. What i want is a label which when clicked performs some functions. Is it possible?
Does anybody have any idea.

thanks in advance.
Offline  
Old 01-09-2008, 06:57 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

make your labelfield focusable and handle the click event as ever, with a changelistener or a navigationevent for example.

hth,
simon
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 01-09-2008, 08:09 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for replying quickly...

I tried it but when i click the label nothing happens. I am using changeListener to handle the event.

Should it work the same as we have in the button click event?

thanks again.
Offline  
Old 01-10-2008, 12:29 AM   #4 (permalink)
New Member
 
Join Date: Jan 2008
Model: no
PIN: N/A
Carrier: se
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Create another CustomLabelField class by extending Labelfield and override trackwheelClick(int status,int time) function. Check this...

public final class CustomLabelField extends LabelField{
public KeyListener m_cKeyListener;
public interface KeyListener{
public abstract void PerformAction(CustomLabelField pCustomLabelField );
}
public void SetKeyListener(KeyListener pKeyListener){
m_cKeyListener = pKeyListener;
}
public boolean trackwheelClick(int status,int time){
boolean lRetVal = false;
if(null !=m_cKeyListener ){
m_cKeyListener.PerformAction(this);
lRetVal = true;
}
return lRetVal;
}
}
try this it will work...........
Offline  
Old 01-14-2008, 11:50 PM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank u very much.
Offline  
Old 01-17-2008, 09:10 AM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks preet

but can u plz tell me when i create a custom button extending the field, it cannot consume the click, i.e. when i click the button, it seems that no event occurs and my function to execute after the event is occured is never executed. i used changeListener to identify which button is clicked.

Plz tell me how to make the button cunsume the click.

thanks once again.
Offline  
Old 01-18-2008, 08:24 AM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

can some one tell me how to add a button click event to a Label, or plz giv me some info in custom button which looks like a label.
Offline  
Old 01-26-2008, 10:51 PM   #8 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks , i got it..
Offline  




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