Skip to content

Commit

Permalink
Updated sample solution to match new API
Browse files Browse the repository at this point in the history
  • Loading branch information
seanthomasdevlin committed Dec 12, 2016
1 parent 56d4619 commit 77a0d7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 3 additions & 2 deletions svyPDFViewerExample/forms/pdfViewer.frm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ location:{
x:20,
y:90
},
noCache:false,
size:{
height:370,
width:600
Expand All @@ -30,7 +31,7 @@ uuid:"2EA11256-E8B8-4EC9-B4A0-4C925185B15C"
},
{
location:"525,40",
onActionMethodID:"F7E79E64-D024-433B-A32A-1934DE5CB699",
onActionMethodID:"3F39F8B8-ADA3-4888-8F3C-F4F8A5581B81",
onDoubleClickMethodID:"-1",
onRightClickMethodID:"-1",
size:"80,30",
Expand All @@ -51,13 +52,13 @@ dataProviderID:"documentURL",
location:"20,40",
onDataChangeMethodID:"FAAFF2F3-46FE-4FD6-9C4B-55EF13903824",
placeholderText:"i.e. http://localhost:8080/test.pdf",
selectOnEnter:true,
size:"500,30",
typeid:4,
uuid:"D629A911-9556-4EA6-BA20-75CA27E3A1E8"
}
],
name:"pdfViewer",
onLoadMethodID:"B2E29DB1-646D-49E1-AB55-DF1FCFDD03F4",
showInMenu:true,
typeid:3,
uuid:"970DF7F6-6947-4148-B515-FA09834A5105"
13 changes: 8 additions & 5 deletions svyPDFViewerExample/forms/pdfViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,21 @@ function onDataChangeDocumentURL(oldValue, newValue, event) {
* @properties={typeid:24,uuid:"F7E79E64-D024-433B-A32A-1934DE5CB699"}
*/
function loadDocument() {
elements.pdfViewer.loadDocument(documentURL);
elements.pdfViewer.documentURL = documentURL;
}

/**
* Load document when form is loaded
* Perform the element default action.
*
* @param {JSEvent} event the event that triggered the action
*
* @private
*
* @properties={typeid:24,uuid:"B2E29DB1-646D-49E1-AB55-DF1FCFDD03F4"}
* @properties={typeid:24,uuid:"3F39F8B8-ADA3-4888-8F3C-F4F8A5581B81"}
*/
function onLoad(event) {
loadDocument();
function reload(event) {
if(!elements.pdfViewer.noCache){
application.output('reload() called with noCache==false. Will likely have no effect.',LOGGINGLEVEL.WARNING);
}
elements.pdfViewer.reload();
}

0 comments on commit 77a0d7d

Please sign in to comment.