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

SEMICONDUCTOR EQUIPMENT 4000 BONDER WITH WORK HOLDER
$200.0
SEMICONDUCTOR EQUIPMENT 4000 BONDER WITH WORK HOLDER pictureLot of 2 NEW FreeScale Semiconductor Pressure Sensor MPX4105A K0615FK
$6.5
Lot of 2 NEW FreeScale Semiconductor Pressure Sensor MPX4105A K0615FK pictureLot of 2 NEW FreeScale Semiconductor Pressure Sensor MPXH610A6T1 K0439
$7.5
Lot of 2 NEW FreeScale Semiconductor Pressure Sensor MPXH610A6T1 K0439 pictureTRW Semiconductors #SD71 (4 total)
$15.0
TRW Semiconductors #SD71 (4 total) pictureTI TMS 32020GBL SemiConductor
$9.95
TI TMS 32020GBL SemiConductor picture






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