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

IBASE IB810-16M SBS , CPU, FAN , 1GB RAM,2LAN,VGA
$995.0
IBASE IB810-16M SBS , CPU, FAN , 1GB RAM,2LAN,VGA pictureFANUC MEMORY MODULE EXPANSION RAM 256K BYTES CMOS IC697MEM717
$3.99
FANUC MEMORY MODULE EXPANSION RAM 256K BYTES CMOS IC697MEM717 pictureNETAPP CONTROLLER PCIE 110-00061+A0 111-00138+G0 WITH RAM 107-00029+A0 AND BBU
$34.0
NETAPP CONTROLLER PCIE 110-00061+A0 111-00138+G0 WITH RAM 107-00029+A0 AND BBU pictureBRIDGEPORT MILL PART, J HEAD MILLING MACHINE RAM PINION 2060255 M1244 USED EXCEL
$54.99
BRIDGEPORT MILL PART, J HEAD MILLING MACHINE RAM PINION 2060255 M1244 USED EXCEL pictureMosel Vitelic V53C16258HT45 256Kx16 EDO Page Mode RAM
$19.99
Mosel Vitelic V53C16258HT45 256Kx16 EDO Page Mode RAM picture






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