Skip to Content
avatar image
Former Member

SAPUI5 How to get the title with NotificationListItem

I had added a button on NotificationListItem and assigned the press event"onRejectPress" and there is a "onListItemPress" also. When I press the line I can goto the function onListItemPress and get the title contants through "oEvent.getSource().getTitle()"

But when I click the button "Reject" I can't get the title contant through "oEvent.getSource().getTitle()". Who can tell me how can I get the title contants in function() onRejectPress". Thank you~

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 22, 2017 at 08:22 PM

    oEvent.getSource().getBindingContext().getObject().Vid

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 23, 2017 at 07:07 AM

    As you can see, title is not a property for Reject Button control, it is having text property. When you tried to get the title from "onListItemPress" method, you got just because you had the event for NotificationListItem control which has title property. Here you want to get the title value of NotificationListItem control from button event which is other control. So you can achieve via bindingcontext from button event where you will get the object of clicked record.

    "oEvent.getSource().getBindingContext().getObject().Vid"

    Add comment
    10|10000 characters needed characters exceeded