在 SAP UI5 的 Fiori 應用中,在 XML 檢視中動態分配圖片源


可以的,但你需要計算動態欄位。

首先,你需要指定繫結是複雜的,因此更改標記 −

“data-sap-ui-bindingSyntax="complex" ”. 

然後,使用一個可用於格式化的輔助函式。

fnImageFmtr: function(value) {
   var imgSrc = "Image" + value;
   return imgSrc;
}

最後,在 XML 檢視中的影像標籤中使用此函式。

<Image src="{path:'<Model Property>',formatter:'. fnImageFmtr}"/>

更新於: 13-Feb-2020

816 次瀏覽

開啟你的 職業

透過完成課程獲得認證

開始
廣告
© . All rights reserved.