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

Intel Server - Xeon X3230 - 8GB RAM - 2 - 1.5TB HDD
$40.0
Intel Server - Xeon X3230 - 8GB RAM - 2 - 1.5TB HDD pictureSUPERMICRO CSE-826 SERVER X9DRD-7LN4F-JBOD 2*INTEL XEON E5-2620 6-CORE 2GHz 98GB
$499.99
SUPERMICRO CSE-826 SERVER X9DRD-7LN4F-JBOD 2*INTEL XEON E5-2620 6-CORE 2GHz 98GB pictureHoneywell Xeon 1900 Barcode Scanner 1900HHD-0 w/ USB Cable
$39.98
Honeywell Xeon 1900 Barcode Scanner 1900HHD-0 w/ USB Cable picture LAMBDA LS SUTTER INSTRUMENT COMPANY XEON ARC LAMP W/ FILTER
$975.0
 LAMBDA LS SUTTER INSTRUMENT COMPANY XEON ARC LAMP W/ FILTER pictureIntel S2600CO Motherboard 32GB DDR3 ecc reg intel xeon 2640 2.5ghz six core
$145.0
Intel S2600CO Motherboard 32GB DDR3 ecc reg intel xeon 2640 2.5ghz six core picture






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