Skip to Content
avatar image
Former Member

Event Parameters in Controller

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Oct 16, 2015 at 03:25 PM

    Hi Robert

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

    some example will do.

    Thanks

    -D

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 16, 2015 at 05:08 PM

    post how do create a fragment

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2015 at 11:41 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 18, 2015 at 12:02 PM

    Hi Robert,

    Will this help? Plunker - Button XML Fragment

    Open console to check the event parameters.

    Regards,

    Sai Vellanki.

    Add comment
    10|10000 characters needed characters exceeded