问题描述
是否有一种方法可以在视图控件(或重复控件)中列出所有文档,并具有下载按钮/链接,使用户可以下载驻留在RTF文本字段中的多个附件?
Is there a way to list all documents in a view control (or a repeat control) and have a download button / link that will allow the user to download multiple attachments that reside in a rich text field?
我已经找到了使用@AttachmentName的选项,但这会列出文档中的所有附件,并且不会将附件限制为仅一个RTF.
I have found options using the @AttachmentName, however this lists all attachments on the document and does not restrict the attachments to just one the RTF.
我有一个使用对话框的解决方法,该对话框效果很好,只是没有我想要的选项干净.
I have a work around using a dialog box, which does work well, just not as clean as the option I was looking for.
推荐答案
在视图中,您可以具有计算列.您放置在对话框中的任何代码都可以放置在计算列中. XSPviewEntry的getDocument()方法使您可以访问文档(明智地循环使用).
In a view you can have a computed column. Any code you place into a dialog could be placed into a computed column. The getDocument() method of the XSPviewEntry gives you access to the document (recycle wisely).
更新
要使用下载控件,请对数据源使用重复的视图,并在每行使用一个面板.面板上的数据源指向文档.使用tr作为面板的标签.
To use a download control, use a repeat with the view as datasource and a panel per row. The panel has the data source pointing to a document. Use tr as tag for the panel.
仅当您不想在其他字段中显示附件时才需要
This is only needed if you have attachments in other fields you don't want to show
这篇关于从视图下载附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!