我想将一个liveChange事件附加到Input基于可重用的字段Fragment(Dialog演练步骤 19:重用对话框)。
在 XML 模板中HelloDialog.fragment.xml我添加了:
<Input
id = "input-b"
type = "Password"
liveChange = ".onLiveChange"
placeholder = "Enter your password" />
Run Code Online (Sandbox Code Playgroud)
在片段的控制器中HelloDialog.js我添加了:
onLiveChange: function (oEvent) {
const sNewValue = oEvent.getParameter("value");
this.byId("getValue").setText(sNewValue);
console.log("sNewValue");
}
Run Code Online (Sandbox Code Playgroud)
然后我在 DevTools 中在此方法中设置一个断点,并尝试在相关内容中键入文本Input,并期望断点将被触发,但什么也没有发生。
我尝试onLiveChange从我调用此片段的位置添加到视图的控制器中Component.js,但仍然没有反应。
为什么onLiveChange我的情况没有触发?在 SAP示例中:输入 - 值更新一切正常,但它们使用常规视图,而不是基于片段的对话框。