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: 120
Registered: ‎02-06-2013
My Device: DAB, DAC, Lost red Z10, Regular Replaced Z10, PlayBook
My Carrier: airtel

Sharing or deleting any file

Hi,

 

How do I go about sharing or deleting any file. I just want to allow sharing and deleting of the selected item through the context menu. 

 

Using invocation framework ? sounds good but not sure how to get started. thanks.



Looking for SMTP Servers, Bulk Emails and Bulk SMS services at an affordable price to help boost your business? Look no further. I've the solution for your needs. Contact me now.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Sharing or deleting any file

Invocation is the way to go it's probablt not as complex as you think.

 

Start here...

 

http://developer.blackberry.com/native/documentation/core/invocation_framework.html


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 120
Registered: ‎02-06-2013
My Device: DAB, DAC, Lost red Z10, Regular Replaced Z10, PlayBook
My Carrier: airtel

Re: Sharing or deleting any file

tried the following code to delete a single item but didn't find it working

void TrackManager::clearOne()
{
	QDirIterator it(trackStorageLocation(), QDir::Files | QDir::NoDotAndDotDot);
	it.filePath();

	        QFile::remove(it.fileInfo().absoluteFilePath());
	        updateTrackInformation();
}

 

contextActions: [
                    ActionSet {
                        title: "Animations"
                        subtitle: "Choose your animation"
                        
                        // This action plays the translation animation
                        DeleteActionItem {
                            title: "Slide"
                            
                            
                            onTriggered: {
                                _trackManager.clearOne()
                            }
                        }
                    
                    }
                ]

 any idea what's missing ?



Looking for SMTP Servers, Bulk Emails and Bulk SMS services at an affordable price to help boost your business? Look no further. I've the solution for your needs. Contact me now.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Sharing or deleting any file

Do you get any warnings or error messages on the console?

If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 120
Registered: ‎02-06-2013
My Device: DAB, DAC, Lost red Z10, Regular Replaced Z10, PlayBook
My Carrier: airtel

Re: Sharing or deleting any file

no absolutely nothing, i was actually running the dictaphone sample app and tried to customize it to delete the single selected item but that doesn't seem to work


Looking for SMTP Servers, Bulk Emails and Bulk SMS services at an affordable price to help boost your business? Look no further. I've the solution for your needs. Contact me now.
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Sharing or deleting any file

I'd recommend throwing in some debug output so you can better figure out what's going on. Is the method actually being called, does the path look right, what's the return value of remove, etc.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Sharing or deleting any file

Also, are you sure the file isn't actually deleted? Does updateTrackInformation update the UI correctly for you?

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker