zl程序教程

您现在的位置是:首页 >  其他

当前栏目

SAP UI5 Input字段live change事件的一个例子

SAP事件 一个 例子 字段 UI5 input Change
2023-09-14 09:02:39 时间

源代码:

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta charset="utf-8">
	<title>SAPUI5 Sandbox</title>
	<script
		id="sap-ui-bootstrap"
		src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
		data-sap-ui-theme="sap_belize"
		data-sap-ui-libs="sap.m"
		data-sap-ui-compatVersion="edge"
		data-sap-ui-preload="async">
	</script>
	<script>
		sap.ui.getCore().attachInit(function () {
			var oInput = new sap.m.Input({
				liveChange : function(oEvent) {
					console.log('live change event: ' + oEvent.getParameter('newValue'));
				}
		});
		oInput.placeAt("content");
		});
	</script>
</head>
<body class="sapUiBody" role="application">
	<div id="content"></div>
</body>
</html>

测试效果:在这里插入图片描述