ObjectListItem "Press" event not firing

Be it

<List id="list" items="{/Report}">
      <items> 
          <ObjectListItem   press="onSelect"  title="{TYPE}"> </ObjectListItem>
      </items>
</List>

      

and

<List id="list" items="{/Report}" itemPress="onSelect">
       <items> 
           <ObjectListItem   title="{TYPE}"> </ObjectListItem>
       </items>
</List>

      

shoots

onSelect : function (oEvent) {
    'use strict';
    console.log("onSelect");
}

      

in the controller.

What could be causing this? There is no corresponding error message in the console.

+3


source to share


1 answer


By default, the ObjectListItem is set to InActive. If you set it to some other type, say "Active", a click event will be raised.

<ObjectListItem
        press="onSelect"
        title="{TYPE}"
        type = "Active">
</ObjectListItem>

      



https://sapui5.hana.ondemand.com/sdk/docs/api/symbols/sap.m.ListType.html

https://openui5.hana.ondemand.com/docs/api/symbols/sap.m.ListBase.html#event:itemPress

+7


source







All Articles