SAPUI5上传集合删除不触发(UI5库1.44)

时间:2019-08-22 10:45:10

标签: sapui5 sap jscript sap-fiori sap-web-ide

我正在尝试从上传集合中删除图像,一旦它在后端系统中进行了更新,但是删除事件没有触发,下面是我的代码:

我尝试过此链接, https://github.com/SAP/openui5/issues/645

但不能解决我的问题。

查看

<UploadCollection 

    id="uploadCollection" 
    uploadUrl="/sap/opu/odata/sap/ODATA_SRV/AttachmentSet"
    items="{ path: 'Emp>/AttachmentSet', 
            filters: [{ path: 'Application', 
                        operator: 'EQ', 
                        value1: 'Test' }] }"
    uploadComplete="onAttachmentUploadComplete" 
    fileSizeExceed="onFileSizeExceed" 
    typeMissmatch="onTypeMissmatch"
    mimeType="image/jpeg,application/pdf,image/pjpeg" 
    maximumFileSize='2' 
    fileDeleted="onAttachmentDeleted" 
    change="onAttachmentChange"
    sameFilenameAllowed="false">

<UploadCollectionItem 
    contributor=""   enableDelete="true"
    documentId="{Emp>Filename}" 
    fileName="{Emp>Filename}" 
    fileSize=""
    mimeType="{Emp>MimeType}" 
    uploadedDate="" 
    url="{__metadata/media_src}" 
    enableEdit="false" 
    visibleEdit="false"/>

<headerParameters>

    <UploadCollectionParameter 
    name="x-csrf-token" 
    value="xyz"/>
</headerParameters>

<parameters/>
</UploadCollection>

控制器:

onAttachmentDeleted: function(e) {
 sap.m.MessageBox.Show("Test Alert");
}

1 个答案:

答案 0 :(得分:0)

嗨,您是否尝试过在UploadCollectionItem中将“ enableDelete”属性包含为true?

下面的API参考

启用/禁用“删除”按钮。如果值为true,则启用“删除”按钮,并且可以使用删除功能。如果值为false,则删除功能不可用。