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

ENERGY STAR CEILING FLUORESCENT FIXTURE ZED-V001 14W W/ ELECTRONIC BALLAST
$45.0
ENERGY STAR CEILING FLUORESCENT FIXTURE ZED-V001 14W W/ ELECTRONIC BALLAST picture9 New Unused Light Ballast
$40.0
9 New Unused Light Ballast pictureAdvance 2-F40 T10, T12 Rapid Start BALLAST R-2S40-TP Mark III NEW IN BOX
$9.99
Advance 2-F40 T10, T12 Rapid Start BALLAST R-2S40-TP Mark III NEW IN BOX pictureLot of (4) Advance 71A8423 400w S51 240v Core & Coil HPS Ballast Brand New
$399.95
Lot of (4) Advance 71A8423 400w S51 240v Core & Coil HPS Ballast Brand New pictureAdvance VM-2SP20-TP F20T12 2-lamp Fluorescent Ballast 277V
$24.99
Advance VM-2SP20-TP F20T12 2-lamp Fluorescent Ballast 277V picture






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