abap2UI5

Flexible Column Layout Landmark Info For Columns

Flexible Column Layout where the first and the last columns have custom Landmark Info

Z2UI5_CL_SMPC_APP_449

Controls sap.f UI5 1.95

The facts

Repository
abap2UI5/samples-controls
Class
Z2UI5_CL_SMPC_APP_449
Source file
z2ui5_cl_smpc_app_449.clas.abap
Library
sap.f
UI5 entity
sap.f.FlexibleColumnLayout
Demo kit sample
sap.f.sample.FlexibleColumnLayoutLandmarkInfo
SAP's own sample
running at sdk.openui5.org ↗
Minimum UI5
1.95
In the playground
runs in the browser, with no system and nothing installed

Keywords: flexiblecolumnlayout, flexible, column, layout, sap.f, flexiblecolumnlayoutlandmarkinfo, flexiblecolumnlayoutaccessiblelandmarkinfo, button, vbox

Controls it builds

Read out of the builder chain by the abap2UI5 linter, not from the category this sample is filed under — which is what makes “which samples build one of these” a question the catalogue can answer at all.

Libraries

Run it here

The sample running, in this page — the app on its own, with no editor over it. Switch to Playground with this code

Nothing is installed and nothing is sent anywhere: the ABAP is compiled to JavaScript in this browser and runs against abap2UI5 itself.

The ABAP

z2ui5_cl_smpc_app_449.clas.abap — 124 lines Read it on GitHub ↗
" @keywords flexiblecolumnlayout flexible column layout sap.f flexiblecolumnlayoutlandmarkinfo flexiblecolumnlayoutaccessiblelandmarkinfo button vbox
" @summary Flexible Column Layout where the first and the last columns have custom Landmark Info
CLASS z2ui5_cl_smpc_app_449 DEFINITION PUBLIC.

  PUBLIC SECTION.
    INTERFACES z2ui5_if_app.

    DATA layout TYPE string VALUE `OneColumn`.

  PROTECTED SECTION.
    DATA client TYPE REF TO z2ui5_if_client.

    METHODS view_display.
    METHODS on_event.

  PRIVATE SECTION.
ENDCLASS.


CLASS z2ui5_cl_smpc_app_449 IMPLEMENTATION.

  METHOD z2ui5_if_app~main.

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

  ENDMETHOD.


  METHOD view_display.

    " the three column views (List/Detail/DetailDetail) are inlined into one view;
    " the original's nested mvc:XMLView reference in beginColumnPages is dropped
    " (app 234 precedent)
    DATA(view) = z2ui5_cl_ui5_view_builder=>factory( ).

    view->ele( n = `View` ns = `mvc`
        )->a( n = `xmlns`        v = `sap.m`
        )->a( n = `xmlns:mvc`    v = `sap.ui.core.mvc`
        )->a( n = `xmlns:f`      v = `sap.f`
        )->a( n = `displayBlock` v = `true`
        )->a( n = `height`       v = `100%`

        " the controller's setLayout( ) calls become one two-way bound layout property
        )->ele( n = `FlexibleColumnLayout` ns = `f`
            )->a( n = `id`     v = `fcl`
            )->a( n = `layout` v = client->_bind( layout )

            )->ele( n = `landmarkInfo` ns = `f`
                )->tag( n = `FlexibleColumnLayoutAccessibleLandmarkInfo` ns = `f`
                    )->a( n = `firstColumnLabel` v = `Custom Label For First Column`
                    )->a( n = `lastColumnLabel`  v = `Test Label for Last Column`

            )->end(
            )->ele( n = `beginColumnPages` ns = `f`
                )->ele( `Page`
                    )->a( n = `id`    v = `listPage`
                    )->a( n = `title` v = `First Column`

                    )->tag( `Button`
                        )->a( n = `class` v = `sapUiTinyMargin`
                        )->a( n = `text`  v = `Navigate to Middle Column`
                        )->a( n = `press` v = client->_event( `SET_DETAIL_PAGE` )

                )->end(
            )->end(

            )->ele( n = `midColumnPages` ns = `f`
                )->ele( `Page`
                    )->a( n = `id`               v = `detailPage`
                    )->a( n = `title`            v = `Middle Column`

                    )->ele( `VBox`
                        )->tag( `Button`
                            )->a( n = `class` v = `sapUiTinyMargin`
                            )->a( n = `text`  v = `Navigate To First Column`
                            )->a( n = `press` v = client->_event( `SET_LIST_PAGE` )
                        )->tag( `Button`
                            )->a( n = `class` v = `sapUiTinyMargin`
                            )->a( n = `text`  v = `Navigate To Last Column`
                            )->a( n = `press` v = client->_event( `SET_DETAIL_DETAIL_PAGE` )

                    )->end(
                )->end(
            )->end(

            )->ele( n = `endColumnPages` ns = `f`
                )->ele( `Page`
                    )->a( n = `id`               v = `detailDetailPage`
                    )->a( n = `title`            v = `Last Column`
                    )->a( n = `backgroundDesign` v = `Transparent`

                    )->tag( `Button`
                        )->a( n = `class` v = `sapUiTinyMargin`
                        )->a( n = `text`  v = `Navigate to Middle Column`
                        )->a( n = `press` v = client->_event( `SET_DETAIL_PAGE` ) ).

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

  ENDMETHOD.


  METHOD on_event.

    CASE client->get_event( ).

      WHEN `SET_LIST_PAGE`.
        layout = `OneColumn`.

      WHEN `SET_DETAIL_PAGE`.
        layout = `TwoColumnsMidExpanded`.

      WHEN `SET_DETAIL_DETAIL_PAGE`.
        layout = `ThreeColumnsEndExpanded`.

    ENDCASE.

  ENDMETHOD.

ENDCLASS.

More in sap.f

Search every abap2UI5 sample · the full list on one page

On this page