Erscheinungsbild
Icon
Anzeige eines SAP-Icons. Die Icon-Bibliothek ist online im SAPUI5 Icon Explorer abrufbar.
Designer-Attribute
| Attribut | Beschreibung | Default |
|---|---|---|
controlId | Eindeutige ID | automatisch generiert |
src | Icon-URL: sap-icon://<name> (z.B. sap-icon://home) | – |
size | Größe (CSS-Wert, z.B. 2rem) | – |
color | Vordergrundfarbe (Hex oder semantisch: Default, Positive, Critical, Negative, Neutral) | – |
backgroundColor | Hintergrundfarbe | – |
tooltip | Tooltip beim Hover | – |
visible | Sichtbar | true |
spanS / spanM / spanL / spanXL | Grid-Layout | 12 |
ABAP-API
Zugriff über me->get_icon( '<controlId>' ).
| Methode | Zweck |
|---|---|
GET_SRC / SET_SRC | Icon-URL |
GET_SIZE / SET_SIZE | Größe |
GET_COLOR / SET_COLOR | Vordergrundfarbe |
GET_TOOLTIP / SET_TOOLTIP | Tooltip |
Geerbte Methoden: siehe Control.
Beispiel: /mobbuild/cl_ex_icon
Toggelt zwischen zwei Icons (arrow-bottom ↔ arrow-top):
abap
METHOD on_pai.
IF me->get_icon( 'icon4' )->get_src( ) EQ 'sap-icon://arrow-bottom'.
me->get_icon( 'icon4' )->set_src( 'sap-icon://arrow-top' ).
ELSE.
me->get_icon( 'icon4' )->set_src( 'sap-icon://arrow-bottom' ).
ENDIF.
ENDMETHOD.Events im Designer
| Event | Auslöser |
|---|---|
onPress | Klick auf das Icon |
Nächste Schritte
- Image – Anzeige eigener Bilder