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: 143
Registered: ‎07-14-2008
My Device: Not Specified
Accepted Solution

Is there a better way to do this?

Is there a better way to do this with say nextFocus()????

 

 

protected void fieldChangeNotify(int context) { super.fieldChangeNotify( context ); if( this.getCursorPosition( ) == 3 ) { getManager( ).getField( ( getManager( ).getFieldWithFocusIndex( ) + 1 ) ).setFocus( ); } }

 

Although this code is within a field within a HFM, there is no nextFocus() method visible from this.getManager(), so I'm confused as the docs for Manager clearly show this method.  I tried an explicit cast but that had no effect.

 

Thoughts?

 

 

 

 

Developer
Posts: 51
Registered: ‎11-27-2008
My Device: Not Specified

Re: Is there a better way to do this?

funny thing:

 

i opend the forum, cause i had a question... (creating own eventhandler for swipe Wert/East kills also

the handler for swipe notrh/south)

 

Before posting my question i thought : "hmm, lets look, what this guy needs"

 

And in the first-line, i found the solution for my problem :-) "super()" :smileysurprised:

 

but unfortunately i know no better way....

New Developer
Posts: 38
Registered: ‎01-21-2009
My Device: Not Specified

Re: Is there a better way to do this?

have you tried not overriding the builtin functionality, that works well too :smileyhappy:
Developer
Posts: 143
Registered: ‎07-14-2008
My Device: Not Specified

Re: Is there a better way to do this?

Too funny.  Glad my post helped you figure out what you needed to know. Just seems like nextFocus() is not really available for some reason, but the above works, so unless Mark has a suggestion it will do for now.

 

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Is there a better way to do this?

I may have misunderstood, but I think your intention is to call getManager().nextFocus(), correct? nextFocus() is a protected function, you cannot call it directly unless you override it and make it public.
Developer
Posts: 143
Registered: ‎07-14-2008
My Device: Not Specified

Re: Is there a better way to do this?

You understood my intention exactly.

 

Thanks for reminding me of the issue of it being protected.  It should have dawned on me why it wasn't visible, duh!