I have the FileUpload component and what I want to do is access the values of the onFileReceived event. Example:
I defined a variable called “filename” when uploading a file
And I want to access this variable from another component, in this case by executing the onActionPerformed event of a button.
But I have a error
I don’t believe perspective events have a .source. If you look at your error, you have an AttributeError
, meaning you tried to get a field or a function from an object that does not have that field or function, in this case, .source
.
Is that the path you get if you select it by using clicking this?
Try remaking your filename =
line but get the path using the path selector on the top right.
Use self.parent
in Perspective where in Vision you would use event.source.parent
. Unless you intend to use .getComponent()
, in which case you’d use self.getSibling()
instead. But this will simply move the problem–the upload is only available in the fileUpload event, not through component properties. The upload event must save the file/filename/metadata somewhere to be retrieved by other components or future actions.
I tried the following:
But when uploading the document the Designer crashes.