OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Methods assigned in XML fragment not triggered

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Guest
I'd like to attach a liveChange event to the Input field of the reusable Fragment-based Dialog (Walkthrough Step 19: Reuse Dialogs).

In XML-template HelloDialog.fragment.xml I've added:

Code:
<Input
    id = "input-b"
    type = "Password"
    liveChange = ".onLiveChange"
    placeholder = "Enter your password" />

In the fragment's controller HelloDialog.js I've added:

Code:
onLiveChange: function (oEvent) {
    const sNewValue = oEvent.getParameter("value");
    this.byId("getValue").setText(sNewValue);
    console.log("sNewValue");
}

Then I set in DevTools a break point in this method and try to type a text in the relevant Input and expect that the break point will be fired but nothing happens.

I've tried to add onLiveChange into the view's controller from where I call this fragment and to the Component.js as well, but still no reaction.

Why onLiveChange is not triggered in my case? In SAP Sample: Input - Value Update everything is OK, but they use a regular view, not a fragment-based dialog.

<p>I'd like to attach a <code>liveChange</code> event to the <code>Input</code> field of the reusable <code>Fragment</code>-based <code>Dialog</code> (<a href="https://openui5.hana.ondemand.com/topic/19453962b8074b7399372c65cbe05370" rel="nofollow noreferrer">Walkthrough Step 19: Reuse Dialogs</a>).</p>
<p>In XML-template <code>HelloDialog.fragment.xml</code> I've added:</p>
<pre class="lang-xml prettyprint-override"><code><Input
id = "input-b"
type = "Password"
liveChange = ".onLiveChange"
placeholder = "Enter your password" />
</code></pre>
<p>In the fragment's controller <code>HelloDialog.js</code> I've added:</p>
<pre class="lang-js prettyprint-override"><code>onLiveChange: function (oEvent) {
const sNewValue = oEvent.getParameter("value");
this.byId("getValue").setText(sNewValue);
console.log("sNewValue");
}
</code></pre>
<p>Then I set in DevTools a break point in this method and try to type a text in the relevant <code>Input</code> and expect that the break point will be fired but nothing happens.</p>
<p>I've tried to add <code>onLiveChange</code> into the view's controller from where I call this fragment and to the <code>Component.js</code> as well, but still no reaction.</p>
<p>Why <code>onLiveChange</code> is not triggered in my case? In SAP <a href="https://openui5.hana.ondemand.com/entity/sap.m.Input/sample/sap.m.sample.InputValueUpdate" rel="nofollow noreferrer">Sample: Input - Value Update</a> everything is OK, but they use a regular view, not a fragment-based dialog.</p>
 

Latest posts

I
Replies
0
Views
1
impact christian
I
Top