diff --git a/src/z2ui5_cl_demo_app_000.clas.abap b/src/z2ui5_cl_demo_app_000.clas.abap index 2c24875e..c6076fd8 100644 --- a/src/z2ui5_cl_demo_app_000.clas.abap +++ b/src/z2ui5_cl_demo_app_000.clas.abap @@ -470,13 +470,20 @@ CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION. ). panel->generic_tile( - header = 'Tree Table' + header = 'Tree Table I' subheader = 'Popup Select Entry' press = client->_event( 'Z2UI5_CL_DEMO_APP_068' ) mode = 'LineMode' class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ). + panel->generic_tile( + header = 'Tree Table II' + subheader = 'Keep state expanded/unexpanded' + press = client->_event( 'Z2UI5_CL_DEMO_APP_178' ) + mode = 'LineMode' + class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' + ). page = page2->panel( expandable = abap_true diff --git a/src/z2ui5_cl_demo_app_178.clas.abap b/src/z2ui5_cl_demo_app_178.clas.abap index 7ffd0dc5..7c2bbd3f 100644 --- a/src/z2ui5_cl_demo_app_178.clas.abap +++ b/src/z2ui5_cl_demo_app_178.clas.abap @@ -1,40 +1,40 @@ -class Z2UI5_CL_DEMO_APP_178 definition - public - final - create public . +CLASS z2ui5_cl_demo_app_178 DEFINITION + PUBLIC + FINAL + CREATE PUBLIC . -public section. + PUBLIC SECTION. - interfaces IF_SERIALIZABLE_OBJECT . - interfaces Z2UI5_IF_APP . + INTERFACES if_serializable_object . + INTERFACES z2ui5_if_app . - types: - BEGIN OF ty_prodh_node_level3, + TYPES: + BEGIN OF ty_prodh_node_level3, is_selected TYPE abap_bool, text TYPE string, prodh TYPE string, END OF ty_prodh_node_level3 . - types: - BEGIN OF ty_prodh_node_level2, + TYPES: + BEGIN OF ty_prodh_node_level2, is_selected TYPE abap_bool, text TYPE string, prodh TYPE string, nodes TYPE STANDARD TABLE OF ty_prodh_node_level3 WITH DEFAULT KEY, END OF ty_prodh_node_level2 . - types: - BEGIN OF ty_prodh_node_level1, + TYPES: + BEGIN OF ty_prodh_node_level1, is_selected TYPE abap_bool, text TYPE string, prodh TYPE string, nodes TYPE STANDARD TABLE OF ty_prodh_node_level2 WITH DEFAULT KEY, END OF ty_prodh_node_level1 . - types: - ty_prodh_nodes TYPE STANDARD TABLE OF ty_prodh_node_level1 WITH DEFAULT KEY . + TYPES: + ty_prodh_nodes TYPE STANDARD TABLE OF ty_prodh_node_level1 WITH DEFAULT KEY . - data PRODH_NODES type TY_PRODH_NODES . - data IS_INITIALIZED type ABAP_BOOL . + DATA prodh_nodes TYPE ty_prodh_nodes . + DATA is_initialized TYPE abap_bool . - methods UI5_DISPLAY_VIEW . + METHODS ui5_display_view . PROTECTED SECTION. DATA client TYPE REF TO z2ui5_if_client. @@ -46,10 +46,10 @@ ENDCLASS. -CLASS Z2UI5_CL_DEMO_APP_178 IMPLEMENTATION. +CLASS z2ui5_cl_demo_app_178 IMPLEMENTATION. - METHOD UI5_DISPLAY_POPUP_TREE_SELECT. + METHOD ui5_display_popup_tree_select. DATA(dialog) = z2ui5_cl_xml_view=>factory_popup( )->dialog( title = 'Choose Product here...' contentheight = '50%' contentwidth = '50%' beforeopen = `setState()` beforeclose = `saveState()` ). @@ -77,14 +77,12 @@ CLASS Z2UI5_CL_DEMO_APP_178 IMPLEMENTATION. ENDMETHOD. - METHOD UI5_DISPLAY_VIEW. + METHOD ui5_display_view. DATA(lv_save_state_js) = `function saveState() {` && |\n| && -* ` debugger;` && |\n| && ` var treeTable = sap.z2ui5.oViewPopup.Fragment.byId("popupId","tree");` && |\n| && ` sap.z2ui5.treeState = treeTable.getBinding('items').getCurrentTreeState();` && |\n| && ` }; `. DATA(lv_reset_state_js) = `function setState() { ` && |\n| && -* ` debugger;` && |\n| && ` var treeTable = sap.z2ui5.oViewPopup.Fragment.byId("popupId","tree");` && |\n| && ` if( sap.z2ui5.treeState == undefined ) {` && |\n| && ` sap.z2ui5.treeState = treeTable.getBinding('items').getCurrentTreeState();` && |\n| && @@ -99,7 +97,7 @@ CLASS Z2UI5_CL_DEMO_APP_178 IMPLEMENTATION. view->_generic( ns = `html` name = `script` )->_cc_plain_xml( lv_reset_state_js ). DATA(page) = view->shell( )->page( - title = 'abap2UI5 - Popup Tree select Entry' + title = 'abap2UI5 - Tree - Open & Close Popup to see the control keeping expanded' navbuttonpress = client->_event( 'BACK' ) shownavbutton = abap_true ). @@ -108,7 +106,7 @@ CLASS Z2UI5_CL_DEMO_APP_178 IMPLEMENTATION. ENDMETHOD. - METHOD UI5_INITIALIZE. + METHOD ui5_initialize. prodh_nodes = VALUE #( ( text = 'Machines' prodh = '00100' @@ -136,7 +134,7 @@ CLASS Z2UI5_CL_DEMO_APP_178 IMPLEMENTATION. ENDMETHOD. - METHOD Z2UI5_IF_APP~MAIN. + METHOD z2ui5_if_app~main. me->client = client. diff --git a/src/z2ui5_cl_demo_app_180.clas.abap b/src/z2ui5_cl_demo_app_180.clas.abap deleted file mode 100644 index c85f500e..00000000 --- a/src/z2ui5_cl_demo_app_180.clas.abap +++ /dev/null @@ -1,149 +0,0 @@ -CLASS z2ui5_cl_demo_app_180 DEFINITION - PUBLIC - FINAL - CREATE PUBLIC . - - PUBLIC SECTION. - - INTERFACES z2ui5_if_app. - -* TYPES: -* BEGIN OF ty_prodh_node_level3, -* is_selected TYPE abap_bool, -* text TYPE string, -* prodh TYPE string, -* END OF ty_prodh_node_level3 . -* TYPES: -* BEGIN OF ty_prodh_node_level2, -* is_selected TYPE abap_bool, -* text TYPE string, -* prodh TYPE string, -* expanded TYPE abap_bool, -* nodes TYPE STANDARD TABLE OF ty_prodh_node_level3 WITH DEFAULT KEY, -* END OF ty_prodh_node_level2 . -* TYPES: -* BEGIN OF ty_prodh_node_level1, -* is_selected TYPE abap_bool, -* text TYPE string, -* prodh TYPE string, -* expanded TYPE abap_bool, -* nodes TYPE STANDARD TABLE OF ty_prodh_node_level2 WITH DEFAULT KEY, -* END OF ty_prodh_node_level1 . -* TYPES: -* ty_prodh_nodes TYPE STANDARD TABLE OF ty_prodh_node_level1 WITH DEFAULT KEY . - TYPES: - BEGIN OF ty_prodh_node_level2_ex, - expanded TYPE abap_bool, - END OF ty_prodh_node_level2_ex . - TYPES: - BEGIN OF ty_prodh_node_level1_ex, - expanded TYPE abap_bool, - nodes TYPE STANDARD TABLE OF ty_prodh_node_level2_ex WITH DEFAULT KEY, - END OF ty_prodh_node_level1_ex . - TYPES: - ty_prodh_nodes_ex TYPE STANDARD TABLE OF ty_prodh_node_level1_ex WITH DEFAULT KEY . - -* DATA prodh_nodes TYPE ty_prodh_nodes . - DATA prodh_nodes_ex TYPE ty_prodh_nodes_ex . - DATA is_initialized TYPE abap_bool . - - METHODS ui5_display_view . - PROTECTED SECTION. - - DATA client TYPE REF TO z2ui5_if_client. - METHODS ui5_initialize. -* METHODS ui5_display_popup_tree_select. - - PRIVATE SECTION. -ENDCLASS. - - - -CLASS z2ui5_cl_demo_app_180 IMPLEMENTATION. - - - METHOD ui5_display_view. - - client->_bind_edit( prodh_nodes_ex ). - - DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( - )->page( - title = 'abap2UI5 - Popup Tree select Entry' - navbuttonpress = client->_event( 'BACK' ) - shownavbutton = abap_true ). - - page->button( text = 'Server Roundtrip 1' press = client->_event( 'POST_01' ) ). - page->button( text = 'Server Roundtrip 2' press = client->_event( 'POST_02' ) ). - - client->view_display( page->stringify( ) ). - - ENDMETHOD. - - - METHOD ui5_initialize. -* prodh_nodes = -* VALUE #( ( text = 'Machines' -* prodh = '00100' -* nodes = VALUE #( ( text = 'Pumps' -* prodh = '0010000100' -* nodes = VALUE #( ( text = 'Pump 001' -* prodh = '001000010000000100' ) -* ( text = 'Pump 002' -* prodh = '001000010000000105' ) -* ) -* ) ) -* ) -* ( text = 'Paints' -* prodh = '00110' -* nodes = VALUE #( ( text = 'Gloss paints' -* prodh = '0011000105' -* nodes = VALUE #( ( text = 'Paint 001' -* prodh = '001100010500000100' ) -* ( text = 'Paint 002' -* prodh = '001100010500000105' ) -* ) -* ) ) -* ) -* ). - prodh_nodes_ex = - VALUE #( ( expanded = abap_false - nodes = VALUE #( - ( expanded = abap_false ) - ) - ) - ( expanded = abap_false - nodes = VALUE #( - ( expanded = abap_false ) - ) - ) - ). - ENDMETHOD. - - - METHOD z2ui5_if_app~main. - - me->client = client. - - IF is_initialized = abap_false. - is_initialized = abap_true. - ui5_initialize( ). - ui5_display_view( ). - ENDIF. - - CASE client->get( )-event. - - WHEN 'POST_01'. - prodh_nodes_ex[ 1 ]-expanded = abap_true. - client->view_model_update( ). - - WHEN 'POST_02'. - prodh_nodes_ex[ 1 ]-nodes[ 1 ]-expanded = abap_true. - client->view_model_update( ). - - WHEN 'BACK'. - client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ). - - ENDCASE. - - ENDMETHOD. -ENDCLASS. diff --git a/src/z2ui5_cl_demo_app_180.clas.xml b/src/z2ui5_cl_demo_app_180.clas.xml deleted file mode 100644 index 33da5bcf..00000000 --- a/src/z2ui5_cl_demo_app_180.clas.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - Z2UI5_CL_DEMO_APP_180 - E - binding - tree structure - 1 - X - X - X - - - -