BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 01-04-2010, 10:47 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2009
Model: 8130
PIN: N/A
Carrier: don't know
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Button is not working on Storm

Please Login to Remove!

Hi,

I have placed two buttons in the VertcalFieldManager and to display both the buttons vertically center, i have used setPositionChild().

Now my problem is only first button is taking events but not the second one.

Below is my code snippet for VerticalFieldManager in which i added two ButtonFields.


VerticalFieldManager formScreenLayout = new VerticalFieldManager(
Manager.USE_ALL_WIDTH) {

protected void sublayout(int maxWidth, int maxHeight) {

MainScreen currentScreen = (MainScreen) UiApplication
.getUiApplication().getActiveScreen();
int height = currentScreen.getHeight();
for (int index = 0; index < currentScreen.getDelegate()
.getFieldCount(); index++) {

if (index != currentScreen.getDelegate()
.getFieldWithFocusIndex())
height -= currentScreen.getDelegate().getField(index)
.getHeight();
else
break;
}

super.sublayout(maxWidth, height);
setExtent(getWidth(), height);

int heightOfFields = getField(0).getHeight()
+ getField(1).getHeight() ;

setPositionChild(getField(0), getField(0).getExtent().x,
(height - heightOfFields) / 2);
setPositionChild(getField(1), getField(1).getExtent().x,
(height - heightOfFields)/2 + getField(0).getHeight());

}

};


Does any one have an idea why second button is not working on Storm????
Offline  
Old 01-06-2010, 09:38 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
Post

You need to override the touchevent mehtod

following link may help you.

capturing touchevent of right most fields
__________________
Crazy for BlackBerry
Offline  
Old 01-13-2010, 02:40 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2009
Model: 8130
PIN: N/A
Carrier: don't know
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks.

I did the same. But i didn't expect that on changing the position of a field, touchEvent() would be overridden.
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

MKS 722A Pressure Transducer, 10 Torr 722A11TCE2FA 13-32VDC in, 0-10VDC out
$105.0
MKS 722A Pressure Transducer, 10 Torr 722A11TCE2FA 13-32VDC in, 0-10VDC out pictureLebow 3132-5K Load Cell WITH RDP Electronics S7DC Transducer Amplifier.,
$599.0
Lebow 3132-5K Load Cell WITH RDP Electronics S7DC Transducer Amplifier., pictureULTRASOUND TRANSDUCER / PROBE (142258)
$250.0
ULTRASOUND TRANSDUCER / PROBE  (142258) picturePHILIPS ATL C4-2 Curved Array Ultrasound Transducer Probe
$299.0
PHILIPS ATL C4-2 Curved Array Ultrasound Transducer Probe picturePHILIPS ATL C5-2 Curved Array Ultrasound Transducer Probe
$299.0
PHILIPS ATL C5-2 Curved Array Ultrasound Transducer Probe picture






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