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
Trusted Contributor
Posts: 108
Registered: ‎01-18-2012
My Device: 9360
My Carrier: AIRTEL

Non Focusable Label Field

I have a strange problem. My label is showing as focusable, though I explicitly set it as non focusable (NON_FOCUSABLE ) and overriden isFoucable() to return false always 

 

protected void onFocus(int direction) {
}

public boolean isFocusable() {
return false;
}

 

 

 


 

Trusted Contributor
Posts: 108
Registered: ‎01-18-2012
My Device: 9360
My Carrier: AIRTEL

Re: Non Focusable Label Field

any helpers ? 

Developer
Posts: 243
Registered: ‎07-22-2011
My Device: BlackBerry Z10
My Carrier: AirTel

Re: Non Focusable Label Field

Hi,

Can u explain little more.. i didnt get u...

 

If u declared  label field like this

LabelField l1 = new LabelField("Label");

then your label field doesnt have any focus...

Regards,

Lakshman..

 

----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

Trusted Contributor
Posts: 108
Registered: ‎01-18-2012
My Device: 9360
My Carrier: AIRTEL

Re: Non Focusable Label Field

not sure because it was added to the grid and grid is added to vertical field maanger. 

 

am using  new LabelField("", Field.NON_FOCUSABLE);

 

grid.add(label, Field.FIELD_RIGHT | FIELD.NON_FOCUSABLE);

 

thx

Sri

 

 

Developer
Posts: 243
Registered: ‎07-22-2011
My Device: BlackBerry Z10
My Carrier: AirTel

Re: Non Focusable Label Field

Hi,

 

No need to give Field.NON_FOCUSABLE by default label field is non focusable only, if want then only give  Field.FOCUSABLE.

 

regards,

Lakshman..

----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

Trusted Contributor
Posts: 108
Registered: ‎01-18-2012
My Device: 9360
My Carrier: AIRTEL

Re: Non Focusable Label Field

I didn;t give initially. since it didnt work, I gave this one explicitly

Developer
Posts: 285
Registered: ‎08-26-2011
My Device: 9900
My Carrier: Not Specified

Re: Non Focusable Label Field

[ Edited ]

Try like this sample code:

 

public class Grid extends MainScreen
{
	public Grid()
	{
		setTitle("GridLayoutDemo");
		GridFieldManager grd=new GridFieldManager(3, 3, 0);
		grd.add(new LabelField("One",Field.FOCUSABLE));
		grd.add(new LabelField("Two"));
		grd.add(new LabelField("Three",Field.FOCUSABLE));
		grd.add(new LabelField("Four"));
		grd.add(new LabelField("Five",Field.FOCUSABLE));
		grd.add(new LabelField("Six"));
		grd.add(new LabelField("Seven",Field.FOCUSABLE));
		grd.add(new LabelField("Eight"));
		grd.add(new LabelField("Nine",Field.FOCUSABLE));
		
		grd.delete(1, 1);
		add(grd);		
		grd.setColumnPadding(10);
		grd.setRowPadding(10);
	}
}

Use Right and Left arrow in the System or TrackWheel;

 

 You said you are using the GridFieldManager; so I give the sample of GFM which some labels are focussed;

==========================================================================

Feel free to click the LIKE Symbol if the solution helps you;

=================================================================================
Feel free to click LIKE button if the solution helps you;
--
Regards,

ALI SHAIK.
Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Non Focusable Label Field

What does it mean "showing as focusable"? Does it look highlighted? Does it change the colors as you havigate across the screen? What are the exact symptoms?

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!