cancel
Showing results for 
Search instead for 
Did you mean: 

Event Parameters in Controller

0 Kudos

Hi,

I have a button in my fragment which is called in my view. In the controller i would like to read the event parameters.

But when the button is pressed , the Event is empty.

For expert advice please.

Controller:

handlesubmit: function(oEvent) {

            console.log("post entry",oEvent);

}

The oEvent parameter and source is empty.

Thanks in Advance

Accepted Solutions (0)

Answers (4)

Answers (4)

saivellanki
Active Contributor
0 Kudos

Hi Robert,

Will this help? Plunker - Button XML Fragment

Open console to check the event parameters.

Regards,

Sai Vellanki.

0 Kudos

Hi,

From the event i would like to know the source and other parameters.

Code:

fragment

<core:FragmentDefinition

   xmlns="sap.m"

   xmlns:core="sap.ui.core" >

<Button text = "pass event" press = "handlepress" />

</core:FragmentDefinition>

View:|

<core:View controllerName="DELETE.view.Master" xmlns:core="sap.ui.core" xmlns:l="sap.ui.layout" xmlns:table="sap.ui.table" xmlns="sap.m">

  <Page id="productListPage" navButtonPress="onNavBack" showNavButton="true" title="{i18n>masterTitle}">

  <content>

  <core:Fragment fragmentName="DELETE.view.test" type="XML" />

</content>

  </Page>

</core:View>

Controller:

handlepress: function (oEvent) {

  console.log(oEvent) ;

  },

Thx

former_member182862
Active Contributor
0 Kudos

Hi Robert

Maybe this will help

JS Bin - Collaborative JavaScript Debugging

All the events work the same way

Thanks

-D

former_member182372
Active Contributor
0 Kudos

post how do create a fragment

former_member182862
Active Contributor
0 Kudos

Hi Robert

Can you share what are the event parameters that you wish to have?

some example will do.

Thanks

-D