cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori Adaptation Project : Button not triggering on press event

Fragment :

<m:Button id = "btn1" press = ".extension.zmyproject.btnSave.showText"/>

Controller :

btnSave.js

return ControllerExtension.extend("zmyproject.btnSave",

{

onInit: function()

{

MessageToast.show("Hello World");

},

showText: function() {

MessageToast.show("Hello World"); MessageBox.error("Error"); console.log("Hello");

}

});

maheshpalavalli
Active Contributor
0 Kudos

is the onInit function triggering?

0 Kudos

No, the oninit function isn't triggering.

maheshpalavalli
Active Contributor
0 Kudos

okay.. how did u create the view extension..?

0 Kudos
  1. Hey,thanks for the response.
  2. Initially I created a fargment where I added and input control and a button.These two controls are displayed on the screen.
  3. Next I hover on the button right click , a dialog box appears with options like extend fragment ,extend controller,remove.
  4. I selected the extend controller as I need to create an on press event for the button.
  5. I entered the file name saveBtn in the popup box and the saveBtn.js file is created.
  6. I code my custom function showText to display the message Toast on click to check if it is working.
  7. This is in the header area of detail page of my travel request v2 app.

Accepted Solutions (0)

Answers (0)