This question already has an answer here:
I need to show an image for every radio button in a radio button group.
I've seen a few examples of custom radio buttons and radio button groups, but none of them is working.
Could someone please point me in the right direction?
The "right direction" would be to first look around what alternatives there are that can help users to achieve their goal (instead of creating a custom control and maintaining it). For example: We can easily imitate the behavior of radio buttons that can display images additionally with the following combination:
sap.m.List with the following properties:
And a subclass of ListItemBase that supports displaying images (e.g.
sap.m.StandardListItem
[1] or.CustomListItem
).Run the example to see it in action:
[1]: In case of
sap.m.StandardListItem
, be aware that it supports only images in quadrat proportions.src Images with diverse proportions will be displayed improperly.I achieved the image radio button option :
Hence, there are two containers: one, for overall containment and other for radiobutton/image aligment.
Result:
Code:
Data :
View :
Image Above RadioButton:
Image Alongside radiobutton
Let me know if you need more explanation and information.