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

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.
Highlighted
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