0
我有一個觀點SAP UI5 DOM操作
<mvc:View controllerName="quiz.controller.View1" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" displayBlock="true"
xmlns="sap.m">
<App>
<pages>
<Page title="{i18n>title}">
<content>
<Text text="{questions>/question/text}"/>
<RadioButtonGroup columns="5" class="sapUiMediumMarginBottom">
<buttons>
<RadioButton id="RB3-1" text="{questions>/question/option/1}"/>
<RadioButton id="RB3-2" text="{questions>/question/option/2}"/>
<RadioButton id="RB3-3" text="{questions>/question/option/3}"/>
<RadioButton id="RB3-4" text="{questions>/question/option/4}"/>
</buttons>
</RadioButtonGroup>
<Button text="Default" press="onPress" />
</content>
</Page>
</pages>
</App>
</mvc:View>
,其中有是有4個選項的問題。我正在尋找顯示按下按鈕後立即選擇的4個無線電框中的一個。
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/m/MessageToast"
], function(Controller,MessageToast) {
"use strict";
return Controller.extend("quiz.controller.View1", {
onPress : function (evt){
// MessageToast.show(); over here i want to show the butoon which is pressed
}
});
});
我如何使用基本javascript document.getElementById()嘗試處理DOM。但它不是在這裏工作