2017-10-09 39 views
0

我的應用程序運行良好。現在我已將SAPUI5庫更改爲CDN 1.48.9版。TileContainer無法設置未定義SAPUI5的屬性'className'版本1.48

我收到以下錯誤:

Uncaught TypeError: Cannot set property 'className' of undefined in TileContainer-dbg.js:1207.

這裏是我的代碼:

<core:View xmlns:core="sap.ui.core" 
     xmlns:mvc="sap.ui.core.mvc" 
     xmlns="sap.m" 
     controllerName="sbmobiledashboard.overview" 
     xmlns:html="http://www.w3.org/1999/xhtml"> 

<Page id="overview.page" title="{i18n>pageEventsOverview}" navButtonPress="handleNavButtonPress" enableScrolling="false"> 
    <content> 
     <TileContainer id="container" tileDelete="handleTileDelete" 
      tiles="{modelTiles>/tiles}"> 
      <StandardTile 
        icon="{modelTiles>icon}" 
        type="{modelTiles>type}" 
        number="{modelTiles>number}" 
        numberUnit="{modelTiles>numberUnit}" 
        title="{modelTiles>title}" 
        info="{modelTiles>info}" 
        infoState="{modelTiles>infoState}" 
        press="handleTilePress" /> 
     </TileContainer> 
    </content> 
</Page> 

我的結果集是這樣的:

{ 
d: { 
results: [ 

{ 

__metadata: { 

id: "http://<host>:8003/sap/opu/odata/<namespace>/<service> 
/homeTilesSet(guid'000C29CE-10EA-1ED7-ABA0-EB1B4D8838E0')", 

uri: "http://<host>:8003/sap/opu/odata/<namespace>/<service> 
/homeTilesSet(guid'000C29CE-10EA-1ED7-ABA0-EB1B4D8838E0')", 

type: "/<namespace>/<service>.homeTiles" 

}, 

guid: "000C29CE-10EA-1ED7-ABA0-EB1B4D8838E0", 

title: "Critical Events (24h)", 

icon: "sap-icon://alert", 

number: "66 ", 

numberUnit: "Events", 

info: "Severity critical", 

infoState: "Error", 

type: "Create" 

}, 

{ 

__metadata: { 

id: "http://<host>:8003/sap/opu/odata/<namespace>/<service> 
/homeTilesSet(guid'000C29CE-10EA-1ED7-ABA0-EB1B4D8858E0')", 

uri: "http://<host>:8003/sap/opu/odata/<namespace>/<service> 
/homeTilesSet(guid'000C29CE-10EA-1ED7-ABA0-EB1B4D8858E0')", 

type: "/<namespace>/<service>.homeTiles" 

}, 

guid: "000C29CE-10EA-1ED7-ABA0-EB1B4D8858E0", 

title: "Event collection (24h)", 

icon: "sap-icon://share-2", 

number: "123 ", 

numberUnit: "Events", 

info: "", 

infoState: "None", 

type: "None" 

},... 

調試器告訴我問題發生在我身上n以上列出的SAPUI5庫函數。在我操作結果集的情況下,只包含第一個圖塊,該應用程序可以工作。 在以前的版本1.30.10中,代碼和相同的結果集正常工作。我想知道是什麼讓它在最新的庫中引發錯誤。

+0

該問題似乎僅限於Chrome。在Firefox中,它適用於我。也許是一個標準的錯誤(?) –

回答

0

我也遇到過1.48.9版本的一些問題。如果您的代碼可以在不同版本上正常工作,請嘗試將SAPUI5庫的版本更改爲1.48.10。您可以在bootstrap部分的index.html中更改它。如果這不能解決問題,請發佈完整的錯誤日誌。

<script id="sap-ui-bootstrap" 
      src="https://sapui5.hana.ondemand.com/1.48.10/resources/sap-ui-core.js" 
      data-sap-ui-libs="sap.m" 
      data-sap-ui-theme="sap_bluecrystal" 
      data-sap-ui-compatVersion="edge" 
      data-sap-ui-resourceroots='{"com.xyz": ""}'> 
     </script> 
+0

我可以證實它的行爲不同於以前的版本。看看引發錯誤的代碼,沒有什麼改變。 –

相關問題