Skip to Content
0

How to shade a items selected from a list

4 days ago

116

avatar image

Hello community, i have a list and so i want to when i press one item this item change the background or change the color so i could identify what item did i press previously and if i press another this change color and the item before gets normal and so on, i'm reading some events from the documentation but i can't find something i know tables have this behave like "standard" but not the list . I tried sending an icon but dit not know how to remove that icon when i press another item

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Christopher Solomon
4 days ago
1

How are you not seeing this behavior? Here is the LIST control (sap.m.list)....

https://sapui5.hana.ondemand.com/sdk/#/sample/sap.m.sample.ListSelection/preview

....and show the behavior you are describing. Which control are you using?

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hi Christopher Solomon, i forgot the propertie mode="SingleSelectMaster" on my list so that was all the problem ! thanks! ! !

1
Naoto Amari

the only problem now i'm facing it's when i press an item this does not fired my event

0

You will figure it out...I have faith in you! =)

0
Christopher Solomon

jajajja thanks , yes i figured it out :D to fire the event of a standarlistitem in a list you must add the propertie selectionChange="onEvent" and this event will trigged the item-event something like this

<List 	headerText="Asesor" 
	selectionChange="onSelectionChangeAsesor"
	mode="SingleSelectMaster"
	id="lAsesor" 
	width="100%"
	items="{/}"
	noDataText="Sin Datos">
	<items>
	   <StandardListItem title="{Cod_asesor} - {Asesor_nomb}" press="onConsultarCitas" type="Active"/>
       </items>
</List>
onSelectionChangeAsesor : function(oEvt) {
			var item = oEvt.getParameter("listItem");
			item.firePress();
		}
This will fire the event onConsultarCitas of the item and at the same time keep shade the item :D hope this help someone else

0