Skip to Content
0

SAPUI5 How to get the title with NotificationListItem

Jun 22, 2017 at 07:36 PM

141

avatar image
Former Member

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~

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jun Wu Jun 22, 2017 at 08:22 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jun 23, 2017 at 07:07 AM
0

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"

Share
10 |10000 characters needed characters left characters exceeded