Samples / Controls / sap.m

Flex Box - Opposing Alignment

In this Flex Box the items are aligned at opposing ends of the container with justifyContent set to 'SpaceBetween'.

Class
z2ui5_cl_smpc_app_394
Repository
abap2UI5/samples-controls
Ports
sap.m.sample.FlexBoxOpposingAlignment
UI5 libraries
sap.m, sap.ui.core
Lowest UI5 release
1.71
In the browser
Runs in the playground
Controls it builds
sap.m.Button, sap.m.FlexBox, sap.m.Panel, sap.ui.core.mvc.View

The class

" @keywords flexbox flex box sap.m flexboxopposingalignment panel button
" @summary In this Flex Box the items are aligned at opposing ends of the container with justifyContent set to 'SpaceBetween'.
" @origin sap.m.sample.FlexBoxOpposingAlignment - https://sdk.openui5.org/entity/sap.m.FlexBox/sample/sap.m.sample.FlexBoxOpposingAlignment (status: reviewed - read against the original, not run)
CLASS z2ui5_cl_smpc_app_394 DEFINITION PUBLIC.

  PUBLIC SECTION.
    INTERFACES z2ui5_if_app.

  PROTECTED SECTION.
    DATA client TYPE REF TO z2ui5_if_client.

    METHODS view_display.

  PRIVATE SECTION.
ENDCLASS.


CLASS z2ui5_cl_smpc_app_394 IMPLEMENTATION.

  METHOD z2ui5_if_app~main.

    me->client = client.
    IF client->check_on_navigated( ).
      view_display( ).
    ENDIF.

  ENDMETHOD.


  METHOD view_display.

    DATA(view) = z2ui5_cl_ui5_view_builder=>factory( ).

    view->ele( n = `View` ns = `mvc`
        )->a( n = `xmlns:mvc` v = `sap.ui.core.mvc`
        )->a( n = `xmlns`     v = `sap.m`

        )->ele( `Panel`
            )->a( n = `headerText` v = `Horizontally opposing flex items`

            )->ele( `FlexBox`
                )->a( n = `alignItems`     v = `Start`
                )->a( n = `justifyContent` v = `SpaceBetween`

                )->tag( `Button`
                    )->a( n = `text` v = `1`
                    )->a( n = `type` v = `Accept`
                )->tag( `Button`
                    )->a( n = `text` v = `2`
                    )->a( n = `type` v = `Reject` ).

    client->view_display( view->stringify( ) ).

  ENDMETHOD.

ENDCLASS.