How to get the key of a CustomData in SAPUI5? -


i access key of customdata, inside list.

xml view:

<standardlistitem title="{name}" press="getselectedid" type="navigation">    <customdata>      <core:customdata key="{id}"/>    </customdata> </standardlistitem> 

i can't pass id of standardlistitem {id} because integer, , reason, not allow. i've created customdata it.

so, whenever press list item key of item. here's exemple of i've tried it.

 getselectedid: function(oselected){               sap.m.messagetoast.show(oselected.getsource().getkey());                } 

the messagetoast see if got right value.

unfortunately getkey() cannot used after getsource, or oselected

how can key of selected item?

calling oselected.getsource().data("key") should it. (for readibility better rename oselected oevent , give event handler name indicating handles event.)


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -