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
New Contributor
Posts: 3
Registered: ‎03-16-2011
My Device: Blackberry curve 8520
My Carrier: Movistar

TableModel focus

Hi,

I have a TableModel with some EditFields on it.  So, I used TableController.FIELD_FOCUS to have access to the fields.  The problem is that with this type of focus when I press de down key, it  doesn´t move down but right.  I want it to move down like when I use TableController.REGION_FOCUS.

 

Can anyone tell me how could it be done?  I tried overriding the TableController and navigationMovement but I don´t know what to do with that.

Super Contributor
Posts: 278
Registered: ‎11-04-2010
My Device: 4.5 and above
My Carrier: none

Re: TableModel focus

Hi,

 

    See this thread for overriding navigationmovement, left,right,up, and down

http://supportforums.blackberry.com/t5/Java-Development/Navigation-response/m-p/1258337#M170221

 

Thanks & Regards

              pp

New Contributor
Posts: 3
Registered: ‎03-16-2011
My Device: Blackberry curve 8520
My Carrier: Movistar

Re: TableModel focus

Thanks for your help.

I finally decided to use GridFieldManager instead of TableModel.

The problem now is that I can´t set a border for each cell, I used:

gridFieldManager.setBorder(BorderFactory.createSimpleBorder(new XYEdges(0, 0, 0, 0), Border.STYLE_DASHED));

But this just set the border around the manager and not to each cell.

Super Contributor
Posts: 278
Registered: ‎11-04-2010
My Device: 4.5 and above
My Carrier: none

Re: TableModel focus

Hi,

   If u want a border for each cell then create a custom component class not manager.

editField or labelfield should be customised to have a border in paint method.

 

that is,

protected void paint(Graphics graphics)

{

      //set color for border

      graphics.drawRoundRect(leftmargin,topmargin,width,height,arcRadius,arcRadius);

      //roundded rectangle or just rect can be drawn

}

check this thread

http://supportforums.blackberry.com/t5/Java-Development/how-to-create-tables-with-borders-in-blackbe...

Thanks & Regards

              pp