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

Adobe AIR Development

Reply
Developer
Posts: 125
Registered: ‎10-02-2011
My Device: Playbook
My Carrier: none

BB10 listItemClicked and onLongPress

How can I prevent the listItemClicked event during a long press?

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 listItemClicked and onLongPress

Can you post some minimum code? How are you listending to the long press?
Developer
Posts: 125
Registered: ‎10-02-2011
My Device: Playbook
My Carrier: none

Re: BB10 listItemClicked and onLongPress

I made a custom list class and overrided onLongPress:

 

public class MyCustomList extends List
	{
		public function MyCustomList()
		{
			super();
		}
		
		override protected function onLongPress():void {
			trace('on long press');
		}
	}

 In my main class I have a listener for MyCustomList:

 

customList.addEventListener(ListEvent.ITEM_CLICKED, onListClick);

 

private function onListClick(event:ListEvent):void {
	trace('onListClick');		
}

 

New Developer
Posts: 32
Registered: ‎12-08-2010
My Device: Red Z10
My Carrier: Indosat

Re: BB10 listItemClicked and onLongPress

You can use Gestouch (https://github.com/fljot/Gestouch/) for long press event :smileyhappy:
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 listItemClicked and onLongPress

That link gets a 404 error.
New Developer
Posts: 126
Registered: ‎06-09-2010
My Device: 9000
My Carrier: T Mobile

Re: BB10 listItemClicked and onLongPress

I've got the same problem, anyone has the solution yet?

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 listItemClicked and onLongPress

You can probably modify this sample to force the item to be unselected on a long press:

http://supportforums.blackberry.com/t5/Adobe-AIR-Development/BB10-List-with-selected-longPress/td-p/...