17
Views
8
Comments
Solved
On mobile List how can i change the item color for ex. when item is selected
Question

Multiple items should be selectable and change there visual appearance
for example backgroundcolor when selected.

A sample List is attached as oap. How can this be done?

playground.oap

mvp_badge
MVP
Rank: #96
Solution

Giorgos Sgouridis wrote:

Thanks Sam,

transitioning from WPF/Xaml UIs will take me some time but the community is awesome here, love it.

1- Could not figure out how to add in Interface the adhoc Attribute IsSelected instead of an Entity Attribute.
2- The !important did not solve my issue. I also renamed the solution to playground2 and deleted the one from my environment so that no changes will be mixed-up. Still don't see the expected behaviour.

- Add Adhoc attribute(Additional temporary attribute) within the Aggregate as shown below

- Click the 'New attribute' link to create Adhoc attribute

- Click the fx icon to set the value/expression for the adhoc attribute (in our case False value)

- see the property section (bottom right corner section) after clicking the newly created adhoc attribute


Please find the attached updated .oml solution file 


HOpe this helps you!


Regards,

Benjith Sam

playground.oml

mvp_badge
MVP
Rank: #96

Hi Giorgos,

I did some code changes in the shared solution file... I hope this is what you are looking for?? See this sample app 

Steps to follow:

1) Introduce an adhoc boolean type attribute within the Aggregate  which is mapped with the List control i.e. let's name it as IsSelected Of boolean type, set the default value to False

2) On click of every List Item, assign/set the negation value to the current ListItem record IsSelected attribute

3) Define a CSS selection class definition on the Screen Style Sheet Section

4) Add the selection style class w.r.t a condition i.e. If current record IsSelected = true then append the defined selection style class with the existing List Item class


Please see the attached .oml file


Hope this helps you!


Regards,

Benjith Sam

playground.oml

Rank: #22942

Thank you both guys,

the client action was missing as i see in the .oml.
Also many tks for the detailed steps regarding adhoc aggregates.

I like the approach with the aggregate as then could
be written a function on a button click that finds all
selected items.

If i wont make it myself i ll post a new question for assistance
until i get the handles with this awesome toolkit.