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: 178
Registered: ‎07-29-2008
My Device: Not Specified

Focus Highlighting on a subclassed ObjectChoiceField

We have run into some focus highlighting issues with Subclassed ObjectChoiceFields on 4.7.0.65 Storms.  Simply put, if we overload drawFocus(Graphics g, boolean on) and just call super, the highlight is drawn incorrectly.  

 

There is an attached project to demonstrate the issue but basically the below code will incorrectly draw the focus highlight

Object [] a = {"win","loose","banana"};

add(new ObjectChoiceField("ChoiceTest",a){

public void drawFocus(Graphics g, boolean on) {

super.drawFocus(g, on); }});

 


 

but this code will draw correctly

 

//testing

Object [] a = {"win","loose","banana"};

add(new ObjectChoiceField("ChoiceTest2",a));

 


 

The two screen shots below reflect this issue. While the simple option would seem to be “don’t overload” we are forced to because of an interface hierarchy having a public drawFocus method in all of our custom fields.  If we do nothing in our overloaded drawFocus call for our ObjectChoiceField class other than call super.  On the storm, if you do nothing in the drawFocus method, focus is correctly drawn; however, this does not work correctly on 4.6 and prior devices.  We had considered checking if the Touchscreen was supported and then not calling super, be we worry that this may change in the future.

 

 Bad FocusGood Focus

 

Is there any input on the "right way" to do all of this?  this was using the 4.7.0 JDE.

 

Matt

BlackBerry Development Advisor
Posts: 15,083
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: Focus Highlighting on a subclassed ObjectChoiceField

I haven't been able to reproduce this.  What is the platform version on the BlackBerry Storm?  You can find this under Options, About.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 178
Registered: ‎07-29-2008
My Device: Not Specified

Re: Focus Highlighting on a subclassed ObjectChoiceField

[ Edited ]
edit : never mind.
Message Edited by haagmm on 12-02-2008 12:55 PM
Developer
Posts: 178
Registered: ‎07-29-2008
My Device: Not Specified

Re: Focus Highlighting on a subclassed ObjectChoiceField

The issue is seen in BlackBerry_Simulators_4.7.0.41_9530.exe the platform is empty on the about screen.
BlackBerry Development Advisor
Posts: 15,083
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: Focus Highlighting on a subclassed ObjectChoiceField

I was using the same version as well.  Do you see this on a plain MainScreen?  Can you post a larger code sample that triggers this behaviour?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 178
Registered: ‎07-29-2008
My Device: Not Specified

Re: Focus Highlighting on a subclassed ObjectChoiceField

the screen shots are taken with this program here : http://tinyurl.com/5csxll  full source, jdw, etc.  sorry i thought i had put the link in the original post.

 

 

BlackBerry Development Advisor
Posts: 15,083
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: Focus Highlighting on a subclassed ObjectChoiceField

I've ran you sample in the version 4.7.0.41 BlackBerry Simulator and still was not able to reproduce the problem.  Are there any configuration steps required to reproduce this?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 178
Registered: ‎07-29-2008
My Device: Not Specified

Re: Focus Highlighting on a subclassed ObjectChoiceField

Ok, i've narrowed it down, there is nothing more we can acomplish via the forum.  thank you for your time.

 

Matt