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

ListField navigationClick problem

Hello, I'm trying to write a small application with a ListField displayed on the MainScreen and each time I select an option from the lis I want to perform an action. I've overriden navigationClick on the ListField. The problem is that navigationClick gets called even if I click outside the list (this is a problem on the storm simulator, I don't know of any other devices with touch screen so it should not  be a problem on other simulators). As far as i'm aware there is no way of getting the position of the click from navigationClick. Can someone help me with this?Is there a way to only revceive navigatioClicks done inside the list?

To summarize: I want to perform an action only when the user clicks inside the list. 

Thank you,

Daniel

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: ListField navigationClick problem

This should not be the case, navigationClick should revieve the click. Can you please post the code which you are trying?

Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
New Developer
danywv
Posts: 7
Registered: ‎03-09-2009
My Device: Not Specified

Re: ListField navigationClick problem

Thanks for the reply, I'll add some detail below

I have a class that extends MainScreen

 

public class ExplorerMainScreen extends MainScreen

 

and a class that extends ObjectListField

 

public class FileListField extends ObjectListField

 

In instantiate a FileListField object and add it to the screen

 

_itemList = new FileListField(); _itemList.setSelectedIndex(-1); add(_itemList);

in FileListField i override navigationClick

 

protected boolean navigationClick(int status, int time) { if ((status & KeypadListener.STATUS_TRACKWHEEL) != KeypadListener.STATUS_TRACKWHEEL) { selectionPerformed(); return true; } return super.navigationClick(status, time); }

The problem is that I always receive navigationClick inside the list even if I clicked outside it.

If there is anything else needed please let me know,

Daniel

 

 

 

 

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: ListField navigationClick problem


danywv wrote:

The problem is that I always receive navigationClick inside the list even if I clicked outside it.

 


I clicked outside, does this means you clicked on some other field on the screen and you recieveing the navigationClick for ListField?

 


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
New Developer
danywv
Posts: 7
Registered: ‎03-09-2009
My Device: Not Specified

Re: ListField navigationClick problem

No, there is no other field on the screen. I'm not familiar with blackberry development so I never stoped to figure out how the layout manager works. Does the list span the entire screen if there is no other field on it?
Please use plain text.
Developer
Rajat_10Sep
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: ListField navigationClick problem

Hi,

Do you want to specifically design an application for touchscreen , In that case Strom is the only option.

 

There are other blackberry emulators also avialable in SDK prior to 4.7 like 8800,8120.

 

I will try to post code for your problem soon.

 

 

Regards,

Rajat Gupta.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Please use plain text.
Developer
peter_strange
Posts: 19,608
Registered: ‎07-14-2008
My Device: Not Specified

Re: ListField navigationClick problem

If there is no other Field on the Screen, then you can't effectively click 'outside' the ListField.  The Click goes to whichever Field has Focus.  If your ListField is the only Field on the Screen,,then focus can not be anywhere else.

 

Are you testing on a Storm?

Please use plain text.
New Developer
danywv
Posts: 7
Registered: ‎03-09-2009
My Device: Not Specified

Re: ListField navigationClick problem

Yes, i got that much :smileyhappy:. Now I'm trying to add another field to the screen that will take up the rest of the remaining space. Tried with t TextField, the problem is that it doesn't seem to resize well. For example, initially I have 2 items in the list, after I click one of them I have more items, but still not a full screen but I get a vertical scroll bar. Is there any way to resize the second field to take up only the vertical space that is left after displaying the list?

 

Please use plain text.
Developer
simon_hain
Posts: 16,207
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: ListField navigationClick problem

you can use a NullField with changed width/height.
----------------------------------------------------------
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.
@SimonHain on twitter
Please use plain text.
Developer
peter_strange
Posts: 19,608
Registered: ‎07-14-2008
My Device: Not Specified

Re: ListField navigationClick problem

[ Edited ]

Try adding a NullField.  I think it will accept Focus and you can hope when a space below the ListField is selected, focus will move.  But I've not tested that, probably the Storm is smart enough to figure out there is no Field there and not move focus!

 

You can probably override the TextBox's layout() method to get to take up all the space.  Not tried this myself either sorry.

 

Let us know if you have no luck with the things you are trying, there are people on this forum who love a challenge like this!

 

Do you want to display anything after the List?

 

Edit: I see Simon and I have managed to Post at the same time again!  Sorry for repeating the NullField suggestion.

Message Edited by peter_strange on 03-09-2009 10:28 AM
Please use plain text.