Forum

Armin Winkler
Moderator
    Has successfully completed the online course Introduction
    Has successfully completed the online course Intermediate (200)
    Has successfully completed the online course Advanced (300)
    Has successfully completed the online course Basics (100)
3 years, 4 months ago #34330
Up
1
Down
::

Hi Roman,

 

you could have made it work using the ColumnListItem’s press event as well. In that case you needed to use the function getSelectedSourceItem of the business object SF_Ui5BindingHelper instead as the press event does not provide any parameter called ‘listItem’ while the itemPress event of the Table does. Please compare the description of the two events on the API Reference of OpenUI5:

 

https://sapui5.hana.ondemand.com/1.71.47/#/api/sap.m.ListItemBase/events/press vs. https://sapui5.hana.ondemand.com/1.71.47/#/api/sap.m.ListBase/events/itemPress

 

Concerning your question: You don’t necessarily have to use a struct with the fields if you rely purely on scripting. However, if you want to use the data source for binding your data to the UI and also want to do field mappings later on you are required to use a proper data type (i.e. struct), yes.

 

Kind regards,

Armin