SAPUI5 UploadCollection即时上传问题

时间:2018-06-13 13:44:02

标签: collections upload sapui5 instant

我有一个奇怪的情况,我在视图中有两个 UploadCollection ,并且两者配置相同,但最具体的是 instantUpload 设置为 false 对彼此而言。唯一的区别是,一个进一步嵌入 sap.m.List 元素和 sap.m.CustomListItem 模板中。即使 instantUpload 设置为 false ,这个仍然会立即上传,而另一个则不会。

以下是显示两个集合的代码片段:

<uxap:ObjectPageSection title="Documents">
  <uxap:subSections>
    <uxap:ObjectPageSubSection title=" ">
      <uxap:blocks>
        <forms:SimpleForm layout="ResponsiveGridLayout" editable="true">
          <UploadCollection
            id="documentsMain"
            noDataText="No documents on file"
            items="{path : 'listItem>/documents', templateShareable : false}"
            mode="SingleSelectMaster"
            uploadUrl="upload.php"
            instantUpload="false"
            multiple="true"
            beforeUploadStarts="onBeforeUploadStarts"
            uploadComplete="onUploadComplete"                                
            selectionChange="onDocumentSelection"
            uploadButtonInvisible="{=${listItem>/draft}!==true}" >
            <items>
              <UploadCollectionItem
                documentId="{listItem>id}"
                fileName="{listItem>name}"
                mimeType="{listItem>type}"
                visibleDelete="{listItem>/draft}"
                deletePress="onDocumentDeleted">
                <attributes>
                  <ObjectAttribute title="File size" text="{ path: 'listItem>size', formatter: '.formatFileSize' }" />
                </attributes>
              </UploadCollectionItem>
            </items>
          </UploadCollection>                           
        </forms:SimpleForm>
      </uxap:blocks>
    </uxap:ObjectPageSubSection>
  </uxap:subSections>
</uxap:ObjectPageSection>                       
<uxap:ObjectPageSection title="Activity" visible="true">                    
  <uxap:subSections>
    <uxap:ObjectPageSubSection title=" ">
      <uxap:blocks>
        <forms:SimpleForm layout="ResponsiveGridLayout" editable="true">                                            
          <List
            id="lst_Activity"
            growing="true"
            noDataText="No activity on file"
            items="{listItem>/activity}"
            itemPress="onActivityItemSelected">
            <layoutData>
              <layout:GridData span="XL12 L12 M12 S12" />
            </layoutData>
            <CustomListItem>
              <UploadCollection
                noDataText="No documents on file"
                items="{path : 'listItem>/documents', templateShareable : false}"
                mode="SingleSelectMaster"
                uploadUrl="upload.php"
                instantUpload="false"
                multiple="true"
                beforeUploadStarts="onBeforeUploadStarts"
                uploadComplete="onUploadComplete"
                selectionChange="onDocumentSelection"
                uploadButtonInvisible="{=${listItem>editable}!==true}" >                        
                <items>
                  <UploadCollectionItem
                    documentId="{listItem>id}"
                    fileName="{listItem>name}"
                    mimeType="{listItem>type}"
                    visibleDelete="{listItem>/draft}"
                    deletePress="onDocumentDeleted">
                    <attributes>
                      <ObjectAttribute title="File size" text="{ path: 'listItem>size', formatter: '.formatFileSize' }" />
                    </attributes>
                  </UploadCollectionItem>
                </items>
              </UploadCollection>   
            </CustomListItem>
          </List>                                           
        </forms:SimpleForm>                                     
      </uxap:blocks>
    </uxap:ObjectPageSubSection>
  </uxap:subSections>
</uxap:ObjectPageSection>

谢谢

0 个答案:

没有答案