I’m working on a blackberry app with intended target OS5+.
I’m creating a GridFieldManager to display data that is fetched from a web-service. Second column of data is often multiline, so i set the lines to be of a bigger height than standard. This is the code for my GridFieldManager:
//Creation and property settings
GridFieldManager myGrid = new GridFieldManager(myScreenData.getSpese().size(), 3, GridFieldManager.USE_ALL_WIDTH|GridFieldManager.VERTICAL_SCROLL);
myGrid.setColumnProperty(0,GridFieldManager.AUTO_SIZE, Display.getWidth()/3);
myGrid.setColumnProperty(1,GridFieldManager.AUTO_SIZE, Display.getWidth()/3);
myGrid.setColumnProperty(2,GridFieldManager.AUTO_SIZE, Display.getWidth()/3);
myGrid.setRowPadding(3);
myGrid.setMargin(3,0,3,0);
for(int i=1;i<myScreenData.getSpese().size()-1;i++){
myGrid.setRowProperty(i, GridFieldManager.FIXED_SIZE, getFont().getHeight()*3);
}
//title population
myGrid.insert(new LabelField("DATA"), 0,FIELD_LEFT);
myGrid.insert(new LabelField("CAUSALE"), 1,FIELD_LEFT);
myGrid.insert(new LabelField("IMPORTO"), 2,FIELD_LEFT);
//Data population
for (int i=0;i<myScreenData.getSpese().size()-1;i++){
System.out.println("aggiungo "+i+" di "+(myScreenData.getSpese().size()-1));
SpesaDateAsString mySpesa = (SpesaDateAsString)myScreenData.getSpese().elementAt(i);
myGrid.insert(new LabelField(mySpesa.getData(),LabelField.FIELD_LEFT|LabelField.FOCUSABLE),0+((i+1)*3),FIELD_LEFT);
myGrid.insert(new LabelField(mySpesa.getCausale(),LabelField.FIELD_LEFT|LabelField.FIELD_VCENTER),1+((i+1)*3),FIELD_LEFT);
myGrid.insert(new LabelField(mySpesa.getImporto(),LabelField.FIELD_LEFT),2+((i+1)*3),FIELD_LEFT);
}
System.out.println("aggiungo la tabella");
result.add(myGrid);
The problem here is that last line of list gets cut. Here’s the screenshot:

Does anyone know what to do? Why is this happening?
I have tried every possible combination of parameters for the row properties (FIXED,AUTO,PREFERRED… ETC) and every possible combinations of paddings and margins. Does anyone know how to solve this?
I think the problem is in this line:
Why your limit is
myScreenData.getSpese().size()-1and test is strict<?Either you use less or equal operator or your limit should be
myScreenData.getSpese().size()