Setting up to display pdf file into pdf viewer
I have followed this to the letter but I continue to get a script error, and I can’t figure out why, I have worked on this till I am blue in the face.
‘’’
# Check to see if the property that changed was the Selected Value property.
if
event.propertyName
=
=
"selectedValue"
:
# Run the query to grab the file name and bytes using the new selected ID value.
system.db.runNamedQuery(
"Read File"
, {
"fileID"
:event.newValue})
# Grab the file bytes and name from the same row.
bytes
=
data.getValueAt(
0
,
"filebyte"
)
(This is my error “data” is not defined!! )
name
=
data.getValueAt(
0
,
"fileName"
)
# Load the bytes into the PDF Viewer component.
event.source.parent.getComponent(
'PDF Viewer'
).loadPDFBytes(bytes, name)
‘’’