Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ObjectListItem "press" event is not fired

Whether this

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

nor this

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

fires

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

in the Controller.

What may cause this? There is no related error message in the console.

like image 995
OddDev Avatar asked Feb 11 '23 00:02

OddDev


1 Answers

By default ObjectListItem type is set to InActive. If its set to any other type, say 'Active' the press event will be triggered.

<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

like image 196
sakthi Avatar answered Feb 12 '23 12:02

sakthi