【发布时间】:2016-02-24 11:01:23
【问题描述】:
我想在方法render中获取属性
sap.ui.define([
"sap/ui/core/Control"
], function (Control) {
"use strict";
return Control.extend("sap.ui.test.control.IndexPageButton", {
metadata : {
properties: {
value: {type : "float", defaultValue : 0},
name: "IndexPageButton",
label: "Label"
},
events: {},
aggregations : {}
},
init : function () {
},
renderer : function (oRM, oControl) {
oRM.write("<div");
oRM.writeControlData(oControl);
oRM.writeClasses();
oRM.write(">");
oRM.write("<span");
oRM.addClass("label");
oRM.write(">");
oRM.write("</span>");
oRM.write("<span");
oRM.addClass("counter");
oRM.write(">");
oRM.write("</span>");
oRM.write("</div>");
}
});
});
XML:
<test:IndexPageButton class="item" value="20" label="{i18n>homePageLink}" />
我想要获取 attrs 值和标签,并将它们粘贴到渲染 sapn 中。
我是怎么做到的?
【问题讨论】:
标签: javascript xml controls sapui5