Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
6 replies
Subscribers
7 subscribers
Views
3993 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Prevent Removal of Uploaded Document
jerimiaht801
over 8 years ago
Hello, I have a use case in which I need to allow a user to upload multiple documents to a SAIL form via a!fileUploadField. Once the desired docs are uploaded, the user clicks a button to commit the documents to the form and sets a Boolean variable that's used to disable the file upload field. I need to prevent the user from adding more documents AND prevent them from removing committed docs once the button is clicked.
I have accomplished the ability to disable the file upload field, preventing additional uploads however the user can still remove uploaded documents from the interface via the X next to the document name. Is there a way to disable all functionality on a file upload field, including the ability to remove docs?
Thanks in advance for your help!
OriginalPostID-247982
Discussion posts and replies are publicly visible
Parents
0
ENOSH EZEKIEL
A Score Level 1
over 8 years ago
@jerimiah - As far as I understand from the requirements, A User will upload as many documents and once he clicks on "File Upload Complete", the user should not be able to remove the documents uploaded previously. To achieve the above requirement, there are 2 ways of doing it.
1.\tMake the "File Upload Complete" button as buttonWidgetSubmit and submit the form and reload. While reloading, (consider ri!uploadedFiles is the list of file uploads), append all values in ri!files to ri!uploadedFiles and check if ri!uploadedFiles is not-empty. If true, then display all the filenames in a textField(with size) with no labels, iterated through a!applyComponents. By this way, the End User will not see the remove link. If you follow the same procedure of creating a Multi-file upload component as mentioned in,
https://forum.appian.com/suite/help/7.11/SAIL_Recipes.html#Add_Multiple_File_Upload_Components_Dynamically
Then, update the rule!ucMultiFileUploadRenderField() with:
=with(
local!paddedArray: append(ri!files, null),
{
if(not(rule!APN_isEmpty(ri!uploadedFiles)),
a!textField(
labelPosition: "ADJACENT",
readOnly: true,
value: concat(document(ri!uploadedFiles,"name"),".",document(ri!uploadedFiles,"extension"),"(",document(ri!uploadedFiles,"size"),"KB)")
),
a!fileUploadField(
label: if(ri!index = 1, ri!label, ""),
target: ri!target,
value: local!paddedArray[ri!index],
saveInto: {
a!save(ri!files, ucMultiFileUploadResizeArray(ri!files, ri!index, save!value))
}
))
}
)
2. You can follow same methodology, and replace the a!textField with a!documentDownloadLink.
Please lemme know if this suffice!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
ENOSH EZEKIEL
A Score Level 1
over 8 years ago
@jerimiah - As far as I understand from the requirements, A User will upload as many documents and once he clicks on "File Upload Complete", the user should not be able to remove the documents uploaded previously. To achieve the above requirement, there are 2 ways of doing it.
1.\tMake the "File Upload Complete" button as buttonWidgetSubmit and submit the form and reload. While reloading, (consider ri!uploadedFiles is the list of file uploads), append all values in ri!files to ri!uploadedFiles and check if ri!uploadedFiles is not-empty. If true, then display all the filenames in a textField(with size) with no labels, iterated through a!applyComponents. By this way, the End User will not see the remove link. If you follow the same procedure of creating a Multi-file upload component as mentioned in,
https://forum.appian.com/suite/help/7.11/SAIL_Recipes.html#Add_Multiple_File_Upload_Components_Dynamically
Then, update the rule!ucMultiFileUploadRenderField() with:
=with(
local!paddedArray: append(ri!files, null),
{
if(not(rule!APN_isEmpty(ri!uploadedFiles)),
a!textField(
labelPosition: "ADJACENT",
readOnly: true,
value: concat(document(ri!uploadedFiles,"name"),".",document(ri!uploadedFiles,"extension"),"(",document(ri!uploadedFiles,"size"),"KB)")
),
a!fileUploadField(
label: if(ri!index = 1, ri!label, ""),
target: ri!target,
value: local!paddedArray[ri!index],
saveInto: {
a!save(ri!files, ucMultiFileUploadResizeArray(ri!files, ri!index, save!value))
}
))
}
)
2. You can follow same methodology, and replace the a!textField with a!documentDownloadLink.
Please lemme know if this suffice!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data