2017-03-02 86 views
0

欲動態設置smartfields的結合路徑:SAPUI5屬性綁定,Variable作爲路徑

var form = new sap.ui.comp.smartform.SmartForm({ 
    title: "not important" 
}); 

form.bindElement("/param"); // 

for (i = 0; i <obj.length; i++){ 
var elem = new sap.ui.comp.smartfield.SmartField({ 
    value: "{obj[i]getAttribute("name")}" 
}); 

obj[i]getAttribute("name") = name and /param/name = "Aline"

我想要的值「A線」是在該領域顯示。

任何想法是值得歡迎的。 謝謝。

回答

0

你可以嘗試像下面這是使用ManagedObject(其中SmartField從繼承)的bindProperty方法...

var elem = new sap.ui.comp.smartfield.SmartField().bindProperty("value",obj[i]getAttribute("name")); 
+0

感謝@Ian,正是我一直在尋找 – Aline