|
| 1 | +class z2ui5_cl_demo_app_220 definition |
| 2 | + public |
| 3 | + create public . |
| 4 | + |
| 5 | +public section. |
| 6 | + |
| 7 | + interfaces IF_SERIALIZABLE_OBJECT . |
| 8 | + interfaces Z2UI5_IF_APP . |
| 9 | + |
| 10 | + data CHECK_INITIALIZED type ABAP_BOOL . |
| 11 | + PROTECTED SECTION. |
| 12 | + |
| 13 | + METHODS display_view |
| 14 | + IMPORTING |
| 15 | + client TYPE REF TO z2ui5_if_client. |
| 16 | + METHODS on_event |
| 17 | + IMPORTING |
| 18 | + client TYPE REF TO z2ui5_if_client. |
| 19 | + |
| 20 | + PRIVATE SECTION. |
| 21 | +ENDCLASS. |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +CLASS z2ui5_cl_demo_app_220 IMPLEMENTATION. |
| 26 | + |
| 27 | + |
| 28 | + METHOD DISPLAY_VIEW. |
| 29 | + |
| 30 | + DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( |
| 31 | + )->page( |
| 32 | + title = 'abap2UI5 - Sample: Rating Indicator' |
| 33 | + navbuttonpress = client->_event( 'BACK' ) |
| 34 | + shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ). |
| 35 | + |
| 36 | + DATA(layout) = page->vertical_layout( class = `sapUiContentPadding` ). |
| 37 | + layout->label( text = `Rating Indicator default size` labelfor = `RI_default` ). |
| 38 | + layout->rating_indicator( id = `RI_default` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` tooltip = `Rating Tooltip` ). |
| 39 | + |
| 40 | + layout->label( text = `Rating Indicator with size L` labelfor = `RI_L` ). |
| 41 | + layout->rating_indicator( id = `RI_L` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` iconSize = `32px` tooltip = `Rating Tooltip` ). |
| 42 | + |
| 43 | + layout->label( text = `Rating Indicator with size M` labelfor = `RI_M` ). |
| 44 | + layout->rating_indicator( id = `RI_M` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` iconSize = `22px` tooltip = `Rating Tooltip` ). |
| 45 | + |
| 46 | + layout->label( text = `Rating Indicator with size S` labelfor = `RI_S` ). |
| 47 | + layout->rating_indicator( id = `RI_S` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` iconSize = `16px` tooltip = `Rating Tooltip` ). |
| 48 | + |
| 49 | + layout->label( text = `Rating Indicator with size XS` labelfor = `RI_XS` ). |
| 50 | + layout->rating_indicator( id = `RI_XS` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` iconSize = `12px` tooltip = `Rating Tooltip` ). |
| 51 | + |
| 52 | + layout->label( text = `Rating Indicator with non active state` labelfor = `RI_EnabledFalse` ). |
| 53 | + layout->rating_indicator( id = `RI_EnabledFalse` maxValue = `5` enabled = `false` class = `sapUiSmallMarginBottom` value = `4` iconSize = `12px` tooltip = `Rating Tooltip` ). |
| 54 | + |
| 55 | + layout->label( text = `Rating Indicator display only` labelfor = `RI_display_only` ). |
| 56 | + layout->rating_indicator( id = `RI_display_only` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` tooltip = `Rating Tooltip` displayonly = abap_true ). |
| 57 | + |
| 58 | + layout->label( text = `Rating Indicator readonly mode` labelfor = `RI_read_only` ). |
| 59 | + layout->rating_indicator( id = `RI_read_only` maxValue = `5` class = `sapUiSmallMarginBottom` value = `4` tooltip = `Rating Tooltip` editable = `false` ). |
| 60 | + |
| 61 | + layout->label( text = `Rating Indicator with different maxValue` labelfor = `RI_maxValue` ). |
| 62 | + layout->rating_indicator( id = `RI_maxValue` maxValue = `8` class = `sapUiSmallMarginBottom` value = `4` tooltip = `Rating Tooltip` ). |
| 63 | + layout->rating_indicator( maxValue = `7` class = `sapUiSmallMarginBottom` value = `4` tooltip = `Rating Tooltip` ). |
| 64 | + layout->rating_indicator( maxValue = `6` class = `sapUiSmallMarginBottom` value = `3` tooltip = `Rating Tooltip` ). |
| 65 | + layout->rating_indicator( maxValue = `5` class = `sapUiSmallMarginBottom` value = `2` ). |
| 66 | + layout->rating_indicator( maxValue = `4` class = `sapUiSmallMarginBottom` value = `2` ). |
| 67 | + |
| 68 | + client->view_display( page->stringify( ) ). |
| 69 | + |
| 70 | + ENDMETHOD. |
| 71 | + |
| 72 | + |
| 73 | + METHOD ON_EVENT. |
| 74 | + |
| 75 | + CASE client->get( )-event. |
| 76 | + WHEN 'BACK'. |
| 77 | + client->nav_app_leave( ). |
| 78 | + ENDCASE. |
| 79 | + |
| 80 | + ENDMETHOD. |
| 81 | + |
| 82 | + |
| 83 | + METHOD Z2UI5_IF_APP~MAIN. |
| 84 | + |
| 85 | + IF check_initialized = abap_false. |
| 86 | + check_initialized = abap_true. |
| 87 | + display_view( client ). |
| 88 | + ENDIF. |
| 89 | + |
| 90 | + on_event( client ). |
| 91 | + |
| 92 | + ENDMETHOD. |
| 93 | +ENDCLASS. |
0 commit comments