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
Developer
Posts: 25
Registered: ‎03-24-2009
My Device: Not Specified
Accepted Solution

Move/next Focus

Hi,

 

I am trying to create a custom popup screen menu.

To do this i have 3 classes:

 

CustomVFM               ->   extends VerticalFieldManager

FileMenuScreen          ->   extends CustomPopupScreen

CustomPopupScreen   ->   extends Screen

 

 I create a CustomVFM 

e.g.

    CustomVFM vfm  = new CustomVFM (Manager.USE_ALL_WIDTH);
    vfm.addLabelField (new LabelField("Download..", LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT));
    vfm.addSeperatorField (new SeparatorField());
    vfm.addLabelField (new LabelField("Communication Options..", LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT));
    vfm.addLabelField (new LabelField("Download Options..", LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT));
    vfm.addLabelField (new LabelField("Change Credentials..", LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT));

 

I then create a "myFMS = FileMenuSrceen(vfm)" and pass in the CustomVFM .

The Constructor for is

 

FileMenuScreen (CustomVFM)

{

   super(vfm)

   ...

}

 

CustomPopupScreen (CustomVFM vfm)

{

   super(new VerticalFieldManager(VERTICAL_SCROLL | VERTICAL_SCROLLBAR));

   add(vfm);

}

 

This creates the screen as i want it.

 

I want to override navigationMovement in myFMS to move the focus to the next element on up and down.

How can i do this?

 

When i call getFieldCount()

It returns 1?

Even though i haveadded 5 Fields as in example above?

 

I have tried nextFocus() but it doesnt work.

 

I would be grateful for any assistance!

 

Cheers,

Bob.

 

 

 

Highlighted
Developer
Posts: 25
Registered: ‎03-24-2009
My Device: Not Specified

Re: Move/next Focus

Disregard,

 

Found solution using:

 

setFocus (Field, x, y, status, time);

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Move/next Focus

I know this is solved, but I think we can clarify something for the next reader.

 

You say getFieldCount returns 1.  Which container did you do this against?