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

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 83
Registered: ‎02-05-2012
My Device: PRIV
My Carrier: T-Mobile

Using ActionItems on ListView items within QML does not behave as expected

I am trying to provide context actions which are available to ListItems in a ListView (Edit / Delete). After looking over the bucketList example I came up with this QML:

 

ListView {
    id: accountsListView
    dataModel: GroupDataModel {
       id: accountsDataModel
    }
    
    listItemComponents: [
        AccountListItem {
            
        }
    ]
    
    
	contextActions: [
	    ActionSet {
	        title: "accountActions"
	        
	        ActionItem {
	            title: "Edit"
	            onTriggered: {
	                console.log("Triggered!")
	                var selectedItem = accountsListView.selected();
	                console.log("got selected item");
	                console.log("Selected item coming:");
	                console.log(typeof(selectedItem));
	                for(var i in selectedItem){
	                    console.log(i);
	                }
	                console.log("Did you catch that?");
	            }
	        }
	        ActionItem {
	            title: "Delete"
	        }
	    }
	]
}

 

 

When I try to activate the 'Edit' action, it works intermittently. It works if I:

 

- Do a Long press on an item in the list

- Remove my finger from the screen

- Then tap the Edit icon

 

It does not work if I:

- Do a Long press on an item in the list

- Drag my finger over to the context menu (without lifting the finger)

- Lift my finger off the screen over the 'Edit' action

 

This is confusing behavior as when I 'drag' my finger over to the context menu I can see the name of the action pop-out to the left which implies that I should be able to perform an action.

 

Has anyone else encountered this behavior? Any solutions? I'd rather not provide unexpected behavior to end users.

 

Thanks.