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
wmatt
Posts: 125
Registered: ‎10-02-2011
My Device: Playbook

BB10 listItemClicked and onLongPress

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

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: BB10 listItemClicked and onLongPress

Can you post some minimum code? How are you listending to the long press?
Please use plain text.
Developer
wmatt
Posts: 125
Registered: ‎10-02-2011
My Device: Playbook

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');		
}

 

Please use plain text.
New Developer
ZanuZawa
Posts: 32
Registered: ‎12-08-2010
My Device: Red Z10

Re: BB10 listItemClicked and onLongPress

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

Re: BB10 listItemClicked and onLongPress

That link gets a 404 error.
Please use plain text.
New Developer
longmilk
Posts: 126
Registered: ‎06-09-2010
My Device: 9000

Re: BB10 listItemClicked and onLongPress

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

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

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/...
Please use plain text.