02-05-2013 05:35 AM
@Peter, it is actually not the same problem. I tried adding only a TableView on a new MainScreen without banner or setStatus. Just a TableView.
It sets focus on row, and it paints the focused rows (Since I am using FocusPolicy of ROW_FOCUS, I also tried Region and Field).
I read previous posts here and here that relates to this problem. In these posts, it is mentioned that, NullField.FOCUSABLE can ber used. So, I added nullfields with FOCUSABLE bit to all my rows. But still not working. I also added nullField with FOCUSABLE bit to top and end of the manager. but none works.
However, in my last post I forgot to mentioned that, this works on 9300 emulator well, but not on the device itself. The scrolling focus never goes out of view in 9300 emulator, but it doens't work as expected in 9800 emulator.
It's my 3rd week on BB development, it's going fine until now. Are these bugs on the platform or what? What other option can one use for TableView? seems not many people are using TableView.
I am using BlackBerry JRE 6.0
02-05-2013 11:59 AM
You are doing very well for 3rd week of BB development!
Back to business: indeed, it seems to be a platform problem. Moreover, I have a strong suspicions that MainScreen and not TableView is to blame. If you really need it to work properly, try going with FullScreen and developing your own custom Manager. Just post here a loose description of the UI you are trying to achieve and we will try to work through it together with you.
02-05-2013 06:08 PM
Agree witn arkadyz, good job for 3 weeks development!
But I'm gonig to disagree with arkadyz here, which is a brave thing to do since he is very good in these things...
I think that TableView is broken in this situation. I think MainScreen is broken too, but has been for years and I think Tableview does not play properly with it.
I think if you define MainScreen as I have done in my previous post, TableView will work correctly, so please try that.
02-07-2013 03:23 AM
@Peter and @Arkardyz, thanks for the contribution.
I found out the height of the TableView at runtime is more than the display height. It actually takes on the height based on the number of rows.
As Peter suggested in the previous post, puting the TableView in a restricted screen (I used restricted manager instead, because, I keep getting exception when I try to override the subLayout method or setExtent for the MainScreen. Therefore I stick with a Manager) is a solution for this.
Also, restricting the height of the TableView itself by overriding it's subLayout method works. In both method, the TableView focus is always on screen and table scrolls as expected.
I had to try the second option (restricting height on TableView itself) because I get NullPointerException just before getting the table into focus with the first option(height restriction on containing manager), but the same NullPointerException occurs.
When I have focus on the banner for example, changing the focus to the table using the touch works fine. But when I use the arrowkeys to move the focus toward the table, I get the NullPointerException when the TableView tries to get the focus. The errorlog shows that exception is from TableView(ScrollView).calculateVerticalScrollAmoun
02-07-2013 05:11 AM
"I found out the height of the TableView at runtime is more than the display height. It actually takes on the height based on the number of rows."
This is correct if you put in an expanding VerticalFieldmanager. If you restrict the height, it will play nicely.
"I keep getting exception when I try to override the subLayout method or setExtent for the MainScreen"
MainScreen has some special features, you should read arkadyz excellent article about it here:
Regarding your NPE, as noted, I think TableView is broken. In my testing I would cause array index exceptions which appeared to be related to moving to the top of the table, so similar to yours. However you may also have found that the processing recoves from this and the user may not notice.
Anyway, am i right in saying you have something that works for you?
02-08-2013 04:24 PM
Thanks for the link.
Well, I believe I have a workable solution in general, still with the exception though. I guess the original setup I had in mind (my first post) is not possible.