Showing posts with label Missing Textbox. Show all posts
Showing posts with label Missing Textbox. Show all posts

Friday, August 21, 2009

Missing Textbox in BlackBerry Application

Recently in one of my BlackBerry projects my development team faced a peculiar error.
We were targeting the device BlackBerry 8900 Curve for the project.
The device we purchased was having OS version 4.6.1.114 and our application was functioning properly on that.
But when we sent the application to our client suddenly he was complaining that one textbox was missing completely. Only difference was that the client was using a BlackBerry 8900 Curve having the OS version 4.6.1.250.
Following are the view at the two ends.
At our device.
At the customer site.

To find out the issue we had to even upgrade the BlackBerry OS and we found that in the new OS version the HorizontalFieldManager is having its default width wrong. So our textbox was hidden. We corrected it by the following change, making the sub layout always have a width that we prefer.

hfmtxtPassword = new HorizontalFieldManager() {

protected void paint(net.rim.device.api.ui.Graphics graphics) {

graphics.setBackgroundColor(Color.WHITE);

graphics.clear();

super.paint(graphics);

}

protected void sublayout(int maxWidth, int maxHeight) {

super.sublayout(278, maxHeight);

}

};