xp : fileDownload 컨트롤을 xp : repeat 컨트롤에서 어떻게 사용할 수 있습니까?XPages - xp : fileDownload 컨트롤에서 xp : repeat 컨트롤
보기에 xp : repeat 컨트롤을 바인드했습니다. 따라서 NotesViewEntry를 한 줄에 가져올 수 있습니다.
하지만 xp : fileDownload 컨트롤에서 var 변수를 사용하여 첨부 파일을 가져 오지 않았습니다.
xp : panel에 xp : repeat를 배치하고 패널 객체에 데이터 문서를 만들었습니다. 이 패널 안에 fileDownload 컨트롤을 배치했습니다. 그리고 바인드 된 문서 데이터 소스를 fileDownload에 바인드합니다.
실무에 실패했습니다.
아이디어가 있으십니까?
10 개의 문서가 있고 모든 문서에는 첨부 파일이 하나 더 있습니다. filedownload 컨트롤을 사용하여 이러한 파일을 표시하려고합니다.
<xp:this.data>
<xp:dominoView var="viewReviews" viewName="vwLookupGoruslerHepsi"></xp:dominoView>
</xp:this.data>
<xp:repeat id="repeat1" value="#{viewReviews}" var="viewEntry">
<xp:table style="width:100%;border:1px solid #ddd;margin-bottom:5px;"
cellpadding="2">
<xp:tr valign="top">
<xp:td rowspan="5" style="width:250px">
<xp:text id="computedField9" tagName="h4" escape="true">
<xp:this.value><![CDATA[#{viewEntry["GorusBildirecek_CN"]}]]></xp:this.value>
</xp:text>
</xp:td>
</xp:tr>
<xp:tr valign="top">
<xp:td>
<xp:panel id="panelGorusEkler">
<xp:this.data>
<xp:dominoDocument var="docGorus" formName="frmGorus"
action="openDocument" documentId="#{javascript:viewEntry.getNoteID()}">
</xp:dominoDocument>
</xp:this.data>
<xp:text escape="true" id="computedField1"
value="#{docGorus.GorusBildiren_OU1_NAME}">
</xp:text>
<xp:fileDownload rows="30" id="fileDownload3"
var="rowFile" indexVar="rowIndex" value="#{docGorus.Ekler}">
</xp:fileDownload>
</xp:panel>
</xp:td>
</xp:tr>
</xp:table>
</xp:repeat>
감사 XP에서
대체 솔루션 fileDownloadLinks : 컨트롤이 필요를 해결하기
대체 방법을 반복합니다.
@AttachmentNames 값을 포함하는 열을 추가했습니다. (열 이름 : $ Ekler)
<xp:tr valign="top">
<xp:this.rendered><![CDATA[#{!empty viewEntry["$Ekler"]}]]></xp:this.rendered>
<xp:td>
<xp:repeat id="repeat2" value="#{viewEntry.$Ekler}" var="embeddedFile">
<xp:link escape="true" id="link1" style="margin-right:10px">
<xp:this.text><![CDATA[#{javascript:var aSizes:Array = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
var embedFile:NotesEmbeddedObject = viewEntry.getDocument().getAttachment(embeddedFile);
var calcnr:Number = Math.floor(Math.log(embedFile.getFileSize())/Math.log(1024));
var fSize = (embedFile.getFileSize()/Math.pow(1024, Math.floor(calcnr))).toFixed(2)+" "+ aSizes[calcnr];
return embedFile.getName() + " (" + fSize + ")"}]]></xp:this.text>
<xp:this.value><![CDATA[#{javascript:"/" + facesContext.getExternalContext().getRequestContextPath() + "/xsp/.ibmmodres/domino/OpenAttachment/" + facesContext.getExternalContext().getRequestContextPath() + "/" + viewEntry.getDocument().getUniversalID() + "/Ekler/" + embeddedFile;}]]></xp:this.value>
</xp:link>
</xp:repeat>
</xp:td>
Ekler는 서식있는 텍스트 필드입니까? 거기에 첨부 파일이 있습니까? – stwissel
http://www.wissel.net/blog/d6plinks/SHWL-86QKNM 링크를 수작업으로 만들 수 있습니다 (단, 아이콘을 직접 관리해야합니다. http://stackoverflow.com/questions/1298518)./where-can-i-find-good-mimetype-icons – stwissel
어쩌면 첨부 파일이 richtext 항목 –