Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
egirotto
Posts: 42
Registered: ‎06-14-2010
My Device: 8900 Bold, 9300

Proble with focus in GridFieldManager (jde 5.0)

Hi,

 

I try to use the GridFieldManager of RIM API 5.0

Everithing work right but i have a problem with focus:

 

I have 2 GridFieldManager: one with 2 cols and 8 rows with labels in the first col and RichTextField in the other and the other with 1 ButtonField for col.

 

When i go down everything work ok, but when i go up and pass from the first button to the last field, focus pass on the label of this field (from the cell 0,0 of the second manager to the 7,0 of the first and not to the 7,1.

 

I overwrite the GridFieldManager because seem that if the movement is up it try to change rows and positionated in the first cell of row but every first cell of every row is not focusable.

I overwrite moveFocus in this manner:

 

 

public int nextFocus(int direction, int axis) {
      int focusIndex = getFieldWithFocusIndex();
      if (direction>0)
          if (++focusIndex>=getFieldCount())
	       return -1;
	  else
	       return focusIndex;
      else
	   if (--focusIndex<0)
	       return -1;
           else
	       return focusIndex;
}

 The label are all non focusable (i forced it overwritten the isFocusable) and the last field (in 7,1) is focusable.

 

 

I can't understand what method is call when the focus enter in the manager to overwrite it (i see onFocus y moveFocus)

 

Any idea?

Thanks!

Contributor
egirotto
Posts: 42
Registered: ‎06-14-2010
My Device: 8900 Bold, 9300

Re: Proble with focus in GridFieldManager (jde 5.0)

hi,

 

to solve it, i used a GridFieldManager class that i found before that it exists in API RIM (in thinkingblackberry.com) and it work fine.

I try to overwrite the navigationMovement of RIM class but still not work.

I find in this forum another thread with this problema but not answer... any idea?

 

thank!