mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-30 11:00:25 +08:00
Dev (#536)
* bugfix serialization * update * add new error message for binding errors * binding and url fix * nested views and custom function
This commit is contained in:
parent
69a1873776
commit
b35537d443
|
@ -106,6 +106,14 @@ CLASS z2ui5_cl_fw_client IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
METHOD z2ui5_if_client~nest_view_display2.
|
||||||
|
|
||||||
|
mo_handler->ms_next-s_set-s_view_nest2-xml = val.
|
||||||
|
mo_handler->ms_next-s_set-s_view_nest2-id = id.
|
||||||
|
mo_handler->ms_next-s_set-s_view_nest2-method_destroy = method_destroy.
|
||||||
|
mo_handler->ms_next-s_set-s_view_nest2-method_insert = method_insert.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
METHOD z2ui5_if_client~nest_view_model_update.
|
METHOD z2ui5_if_client~nest_view_model_update.
|
||||||
|
|
||||||
|
@ -113,6 +121,11 @@ CLASS z2ui5_cl_fw_client IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
METHOD z2ui5_if_client~nest_view_model_update2.
|
||||||
|
|
||||||
|
mo_handler->ms_next-s_set-s_view_nest2-check_update_model = abap_true.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
METHOD z2ui5_if_client~popover_destroy.
|
METHOD z2ui5_if_client~popover_destroy.
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,14 @@ CLASS z2ui5_cl_fw_handler DEFINITION
|
||||||
check_destroy TYPE abap_bool,
|
check_destroy TYPE abap_bool,
|
||||||
check_update_model TYPE abap_bool,
|
check_update_model TYPE abap_bool,
|
||||||
END OF s_view_nest,
|
END OF s_view_nest,
|
||||||
|
BEGIN OF s_view_nest2,
|
||||||
|
xml TYPE string,
|
||||||
|
id TYPE string,
|
||||||
|
method_insert TYPE string,
|
||||||
|
method_destroy TYPE string,
|
||||||
|
check_destroy TYPE abap_bool,
|
||||||
|
check_update_model TYPE abap_bool,
|
||||||
|
END OF s_view_nest2,
|
||||||
BEGIN OF s_popup,
|
BEGIN OF s_popup,
|
||||||
xml TYPE string,
|
xml TYPE string,
|
||||||
id TYPE string,
|
id TYPE string,
|
||||||
|
|
|
@ -15,7 +15,8 @@ CLASS z2ui5_cl_fw_http_handler DEFINITION
|
||||||
t_config TYPE z2ui5_if_client=>ty_t_name_value OPTIONAL
|
t_config TYPE z2ui5_if_client=>ty_t_name_value OPTIONAL
|
||||||
content_security_policy TYPE clike OPTIONAL
|
content_security_policy TYPE clike OPTIONAL
|
||||||
check_logging TYPE abap_bool OPTIONAL
|
check_logging TYPE abap_bool OPTIONAL
|
||||||
custom_js type string optional
|
custom_js TYPE string OPTIONAL
|
||||||
|
custom_js_oneventfrontend TYPE string OPTIONAL
|
||||||
PREFERRED PARAMETER t_config
|
PREFERRED PARAMETER t_config
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(r_result) TYPE string.
|
VALUE(r_result) TYPE string.
|
||||||
|
@ -133,7 +134,25 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
|
||||||
` oParent[sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.METHOD_INSERT](oView);` && |\n| &&
|
` oParent[sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.METHOD_INSERT](oView);` && |\n| &&
|
||||||
` sap.z2ui5.checkNestAfter = true;` && |\n| &&
|
` sap.z2ui5.checkNestAfter = true;` && |\n| &&
|
||||||
` sap.z2ui5.oViewNest = oView;` && |\n| &&
|
` sap.z2ui5.oViewNest = oView;` && |\n| &&
|
||||||
` sap.z2ui5.oView.setModel( sap.z2ui5.oViewNest.getModel( ) );` && |\n| &&
|
` // sap.z2ui5.oView.setModel( sap.z2ui5.oViewNest.getModel( ) );` && |\n| &&
|
||||||
|
` // sap.z2ui5.oLastView = oView;` && |\n| &&
|
||||||
|
` },);` && |\n| &&
|
||||||
|
` }` && |\n| &&
|
||||||
|
` }` && |\n| &&
|
||||||
|
` if (sap.z2ui5.checkNestAfter2 == false) {` && |\n| &&
|
||||||
|
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.XML !== '') {` && |\n| &&
|
||||||
|
` sap.z2ui5.oController.NestViewDestroy2( );` && |\n| &&
|
||||||
|
` new sap.ui.core.mvc.XMLView.create({` && |\n| &&
|
||||||
|
` definition: sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.XML,` && |\n| &&
|
||||||
|
` controller: sap.z2ui5.oControllerNest2,` && |\n| &&
|
||||||
|
` }).then(oView => {` && |\n| &&
|
||||||
|
` oView.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL));` && |\n| &&
|
||||||
|
` var oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.ID);` && |\n| &&
|
||||||
|
` try { oParent[sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.METHOD_DESTROY](); } catch { }` && |\n| &&
|
||||||
|
` oParent[sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.METHOD_INSERT](oView);` && |\n| &&
|
||||||
|
` sap.z2ui5.checkNestAfter2 = true;` && |\n| &&
|
||||||
|
` sap.z2ui5.oViewNest2 = oView;` && |\n| &&
|
||||||
|
` // sap.z2ui5.oView.setModel( sap.z2ui5.oViewNest.getModel( ) );` && |\n| &&
|
||||||
` // sap.z2ui5.oLastView = oView;` && |\n| &&
|
` // sap.z2ui5.oLastView = oView;` && |\n| &&
|
||||||
` },);` && |\n| &&
|
` },);` && |\n| &&
|
||||||
` }` && |\n| &&
|
` }` && |\n| &&
|
||||||
|
@ -200,6 +219,12 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
|
||||||
` }` && |\n| &&
|
` }` && |\n| &&
|
||||||
` sap.z2ui5.oViewNest.destroy();` && |\n| &&
|
` sap.z2ui5.oViewNest.destroy();` && |\n| &&
|
||||||
` },` && |\n| &&
|
` },` && |\n| &&
|
||||||
|
` NestViewDestroy2: () => {` && |\n| &&
|
||||||
|
` if (!sap.z2ui5.oViewNest2) {` && |\n| &&
|
||||||
|
` return;` && |\n| &&
|
||||||
|
` }` && |\n| &&
|
||||||
|
` sap.z2ui5.oViewNest2.destroy();` && |\n| &&
|
||||||
|
` },` && |\n| &&
|
||||||
` ViewDestroy: () => {` && |\n| &&
|
` ViewDestroy: () => {` && |\n| &&
|
||||||
` if (!sap.z2ui5.oView) {` && |\n| &&
|
` if (!sap.z2ui5.oView) {` && |\n| &&
|
||||||
` return;` && |\n| &&
|
` return;` && |\n| &&
|
||||||
|
@ -209,6 +234,7 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
|
||||||
` ` && |\n| &&
|
` ` && |\n| &&
|
||||||
` onEventFrontend: (...args) => {` && |\n| &&
|
` onEventFrontend: (...args) => {` && |\n| &&
|
||||||
|\n| &&
|
|\n| &&
|
||||||
|
custom_js_oneventfrontend &&
|
||||||
` switch (args[0].EVENT) {` && |\n| &&
|
` switch (args[0].EVENT) {` && |\n| &&
|
||||||
` case 'LOCATION_RELOAD':` && |\n| &&
|
` case 'LOCATION_RELOAD':` && |\n| &&
|
||||||
` window.location = args[1];` && |\n| &&
|
` window.location = args[1];` && |\n| &&
|
||||||
|
@ -322,6 +348,10 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
|
||||||
` console.log('UI5-XML-Nest:');` && |\n| &&
|
` console.log('UI5-XML-Nest:');` && |\n| &&
|
||||||
` console.log(sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.XML);` && |\n| &&
|
` console.log(sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.XML);` && |\n| &&
|
||||||
` }` && |\n| &&
|
` }` && |\n| &&
|
||||||
|
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.XML !== '') {` && |\n| &&
|
||||||
|
` console.log('UI5-XML-Nest2:');` && |\n| &&
|
||||||
|
` console.log(sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.XML);` && |\n| &&
|
||||||
|
` }` && |\n| &&
|
||||||
` }` && |\n| &&
|
` }` && |\n| &&
|
||||||
|\n| &&
|
|\n| &&
|
||||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.CHECK_DESTROY == true) { sap.z2ui5.oController.ViewDestroy(); }` && |\n| &&
|
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.CHECK_DESTROY == true) { sap.z2ui5.oController.ViewDestroy(); }` && |\n| &&
|
||||||
|
@ -348,6 +378,7 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
|
||||||
` } else {` && |\n| &&
|
` } else {` && |\n| &&
|
||||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.CHECK_UPDATE_MODEL == true) { sap.z2ui5.oView.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL)); }` && |\n| &&
|
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.CHECK_UPDATE_MODEL == true) { sap.z2ui5.oView.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL)); }` && |\n| &&
|
||||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.CHECK_UPDATE_MODEL == true) { sap.z2ui5.oViewNest.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL)); }` && |\n| &&
|
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.CHECK_UPDATE_MODEL == true) { sap.z2ui5.oViewNest.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL)); }` && |\n| &&
|
||||||
|
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST2.CHECK_UPDATE_MODEL == true) { sap.z2ui5.oViewNest2.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL)); }` && |\n| &&
|
||||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPUP.CHECK_UPDATE_MODEL == true) { sap.z2ui5.oViewPopup.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL)); }` && |\n| &&
|
` if (sap.z2ui5.oResponse.PARAMS.S_POPUP.CHECK_UPDATE_MODEL == true) { sap.z2ui5.oViewPopup.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL)); }` && |\n| &&
|
||||||
` if (sap.z2ui5.oResponse.PARAMS.S_POPOVER.CHECK_UPDATE_MODEL == true) { sap.z2ui5.oViewPopover.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL)); }` && |\n| &&
|
` if (sap.z2ui5.oResponse.PARAMS.S_POPOVER.CHECK_UPDATE_MODEL == true) { sap.z2ui5.oViewPopover.setModel(new sap.ui.model.json.JSONModel(sap.z2ui5.oResponse.OVIEWMODEL)); }` && |\n| &&
|
||||||
` sap.z2ui5.oController.onAfterRendering();` && |\n| &&
|
` sap.z2ui5.oController.onAfterRendering();` && |\n| &&
|
||||||
|
@ -392,6 +423,7 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
|
||||||
|\n| &&
|
|\n| &&
|
||||||
` sap.z2ui5.checkTimerActive = false;` && |\n| &&
|
` sap.z2ui5.checkTimerActive = false;` && |\n| &&
|
||||||
` sap.z2ui5.checkNestAfter = false;` && |\n| &&
|
` sap.z2ui5.checkNestAfter = false;` && |\n| &&
|
||||||
|
` sap.z2ui5.checkNestAfter2 = false;` && |\n| &&
|
||||||
|\n| &&
|
|\n| &&
|
||||||
` sap.z2ui5.oBody.OLOCATION = {` && |\n| &&
|
` sap.z2ui5.oBody.OLOCATION = {` && |\n| &&
|
||||||
` ORIGIN: window.location.origin,` && |\n| &&
|
` ORIGIN: window.location.origin,` && |\n| &&
|
||||||
|
@ -425,7 +457,9 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
|
||||||
` var oView = sap.ui.xmlview({ viewContent: xml });` && |\n| &&
|
` var oView = sap.ui.xmlview({ viewContent: xml });` && |\n| &&
|
||||||
` sap.z2ui5.oController = oView.getController();` && |\n| &&
|
` sap.z2ui5.oController = oView.getController();` && |\n| &&
|
||||||
` var oViewNest = sap.ui.xmlview({ viewContent: xml });` && |\n| &&
|
` var oViewNest = sap.ui.xmlview({ viewContent: xml });` && |\n| &&
|
||||||
|
` var oViewNest2 = sap.ui.xmlview({ viewContent: xml });` && |\n| &&
|
||||||
` sap.z2ui5.oControllerNest = oViewNest.getController();` && |\n| &&
|
` sap.z2ui5.oControllerNest = oViewNest.getController();` && |\n| &&
|
||||||
|
` sap.z2ui5.oControllerNest2 = oViewNest.getController();` && |\n| &&
|
||||||
` sap.z2ui5.checkLogActive = ` && z2ui5_cl_fw_utility=>boolean_abap_2_json( check_logging ) && `;` && |\n| &&
|
` sap.z2ui5.checkLogActive = ` && z2ui5_cl_fw_utility=>boolean_abap_2_json( check_logging ) && `;` && |\n| &&
|
||||||
` sap.z2ui5.oBody = {};` && |\n| &&
|
` sap.z2ui5.oBody = {};` && |\n| &&
|
||||||
` sap.z2ui5.oBody.APP_START = sap.z2ui5.APP_START;` && |\n| &&
|
` sap.z2ui5.oBody.APP_START = sap.z2ui5.APP_START;` && |\n| &&
|
||||||
|
|
|
@ -14,6 +14,7 @@ INTERFACE z2ui5_if_client
|
||||||
BEGIN OF cs_view,
|
BEGIN OF cs_view,
|
||||||
main TYPE string VALUE `MAIN`,
|
main TYPE string VALUE `MAIN`,
|
||||||
nested TYPE string VALUE `NESTED`,
|
nested TYPE string VALUE `NESTED`,
|
||||||
|
nested2 TYPE string VALUE `NESTED2`,
|
||||||
popover TYPE string VALUE `POPOVER`,
|
popover TYPE string VALUE `POPOVER`,
|
||||||
popup TYPE string VALUE `POPUP`,
|
popup TYPE string VALUE `POPUP`,
|
||||||
END OF cs_view.
|
END OF cs_view.
|
||||||
|
@ -96,9 +97,17 @@ INTERFACE z2ui5_if_client
|
||||||
method_insert TYPE clike
|
method_insert TYPE clike
|
||||||
method_destroy TYPE clike OPTIONAL.
|
method_destroy TYPE clike OPTIONAL.
|
||||||
|
|
||||||
|
METHODS nest_view_display2
|
||||||
|
IMPORTING
|
||||||
|
val TYPE clike
|
||||||
|
id TYPE clike
|
||||||
|
method_insert TYPE clike
|
||||||
|
method_destroy TYPE clike OPTIONAL.
|
||||||
|
|
||||||
METHODS nest_view_destroy.
|
METHODS nest_view_destroy.
|
||||||
|
|
||||||
METHODS nest_view_model_update.
|
METHODS nest_view_model_update.
|
||||||
|
METHODS nest_view_model_update2.
|
||||||
|
|
||||||
METHODS cursor_set
|
METHODS cursor_set
|
||||||
IMPORTING
|
IMPORTING
|
||||||
|
|
Loading…
Reference in New Issue
Block a user