BlackBerry Forums Support Community

BlackBerry Forums Support Community (
-   Developer Forum (
-   -   Button is not working on Storm (

vidhi.thakrar 01-04-2010 10:47 AM

Button is not working on Storm

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
int height = currentScreen.getHeight();
for (int index = 0; index < currentScreen.getDelegate()
.getFieldCount(); index++) {

if (index != currentScreen.getDelegate()
height -= currentScreen.getDelegate().getField(index)

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????

renuka_anil 01-06-2010 09:38 AM

You need to override the touchevent mehtod

following link may help you.

vidhi.thakrar 01-13-2010 02:40 AM


I did the same. But i didn't expect that on changing the position of a field, touchEvent() would be overridden.

All times are GMT -5. The time now is 11:20 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.