I want to create an onclick event in my mobile app that opens a PDF. The PDF will be different depending on what record you are looking at. I have in my database table a column titled "datasheet". the value in that table is just a URL, the pdf files are stored on my server. So for example, the value might be "datasheets/axis/ds_m5014_46858_en_1203_lo.pdf". The full path to the file is:
https://snap.scansourcesecurity.com/...en_1203_lo.pdf
I have all of this working fine in a grid component, but of course am not finding it as easy in a UX. I have attached a few screen shots of my attempt to do this in the UX. I found something called "phonegap - open file with native application". This sounds promising. And yes, I have the cordova plugin installed as part of my phonegap build.
In this screenshot, I am attempting to just simply test a static URL path with the following setup:
native.JPG
When I run the app, and click on that control, I get the following error:
error.jpg
So that is part one of my question, figuring out why this results in the error. Part two of my question is this, what would the javascript look like to pull the URL path from my database instead of a static field. Would something like this work:
function getFiles() {
var _d = {dialog.object}.getControl('DATASHEET');
return _d;
}
note: 'DATASHEET' is the name of my control.
If there was a part three to this, it would be that instead of displaying the actual url in my mobile app (ie - datasheets/axis/ds_m5014_46858_en_1203_lo.pdf), I would rather display something like "click here".
All of these things I mentioned are very easy to do in a grid. Just struggling with how to achieve in a UX. Any help would be appreciated.
Thanks!
https://snap.scansourcesecurity.com/...en_1203_lo.pdf
I have all of this working fine in a grid component, but of course am not finding it as easy in a UX. I have attached a few screen shots of my attempt to do this in the UX. I found something called "phonegap - open file with native application". This sounds promising. And yes, I have the cordova plugin installed as part of my phonegap build.
In this screenshot, I am attempting to just simply test a static URL path with the following setup:
native.JPG
When I run the app, and click on that control, I get the following error:
error.jpg
So that is part one of my question, figuring out why this results in the error. Part two of my question is this, what would the javascript look like to pull the URL path from my database instead of a static field. Would something like this work:
function getFiles() {
var _d = {dialog.object}.getControl('DATASHEET');
return _d;
}
note: 'DATASHEET' is the name of my control.
If there was a part three to this, it would be that instead of displaying the actual url in my mobile app (ie - datasheets/axis/ds_m5014_46858_en_1203_lo.pdf), I would rather display something like "click here".
All of these things I mentioned are very easy to do in a grid. Just struggling with how to achieve in a UX. Any help would be appreciated.
Thanks!