如何计算附加的文件(已上载)

时间:2016-12-09 12:05:53

标签: count upload sapui5

我需要计算UploadCollectionItem上传了多少个附件(UploadCollection)。

这是我的代码:

<IconTabFilter icon="sap-icon://attachment"
            stretchContentHeight="true" text="Anexos"
            count=""
            >
            <UploadCollection id="uploadCollection" items="{path: 'att>/d/results'}"
                uploadComplete="onAttachmentUploadComplete" change="onAttachmentChange"
                fileDeleted="onAttachmentDeleted" sameFilenameAllowed="true"
                uploadUrl="/sap/opu/odata/sap/ZWEB_MM0007_SRV/FileProcessSet">
                <items>
                    <UploadCollectionItem id="idUploadListItems"
                        documentId="{att>Id}" fileName="{att>FileName}" mimeType="{att>MimeType}"
                        uploadedDate=""
                        url="/sap/opu/odata/sap/ZWEB_MM0007_SRV/FileProcessSet(Id='{att>Id}',Filename='{att>FileName}',Requisicao='')/$value"
                        enableEdit="false" visibleEdit="false" visibleDelete="true" />
                </items>
                <parameters />
            </UploadCollection>
        </IconTabFilter>

我想在图标上显示相应数量的附件。

1 个答案:

答案 0 :(得分:0)

我的建议是:

    <IconTabFilter icon="sap-icon://attachment"
        stretchContentHeight="true" text="Anexos"

    //here the count        
    count="{att>/d/results.length}"

        >
        <UploadCollection id="uploadCollection" items="{path: 'att>/d/results'}"
            uploadComplete="onAttachmentUploadComplete" change="onAttachmentChange"
            fileDeleted="onAttachmentDeleted" sameFilenameAllowed="true"
            uploadUrl="/sap/opu/odata/sap/ZWEB_MM0007_SRV/FileProcessSet">
            <items>
                <UploadCollectionItem id="idUploadListItems"
                    documentId="{att>Id}" fileName="{att>FileName}" mimeType="{att>MimeType}"
                    uploadedDate=""
                    url="/sap/opu/odata/sap/ZWEB_MM0007_SRV/FileProcessSet(Id='{att>Id}',Filename='{att>FileName}',Requisicao='')/$value"
                    enableEdit="false" visibleEdit="false" visibleDelete="true" />
            </items>
            <parameters />
        </UploadCollection>
    </IconTabFilter>