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

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

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

html - jQuery UI Sortable - Remove placeholder after item is dropped -