* bugfix serialization

* update

* add new error message for binding errors

* binding and url fix

* nested views and custom function
This commit is contained in:
oblomov 2023-09-10 09:59:39 +02:00 committed by GitHub
parent 69a1873776
commit b35537d443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 75 additions and 11 deletions

View File

@ -106,6 +106,14 @@ CLASS z2ui5_cl_fw_client IMPLEMENTATION.
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.
@ -113,6 +121,11 @@ CLASS z2ui5_cl_fw_client IMPLEMENTATION.
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.

View File

@ -23,6 +23,14 @@ CLASS z2ui5_cl_fw_handler DEFINITION
check_destroy TYPE abap_bool,
check_update_model TYPE abap_bool,
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,
xml TYPE string,
id TYPE string,

View File

@ -15,7 +15,8 @@ CLASS z2ui5_cl_fw_http_handler DEFINITION
t_config TYPE z2ui5_if_client=>ty_t_name_value OPTIONAL
content_security_policy TYPE clike 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
RETURNING
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| &&
` sap.z2ui5.checkNestAfter = true;` && |\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| &&
` },);` && |\n| &&
` }` && |\n| &&
@ -200,6 +219,12 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
` }` && |\n| &&
` sap.z2ui5.oViewNest.destroy();` && |\n| &&
` },` && |\n| &&
` NestViewDestroy2: () => {` && |\n| &&
` if (!sap.z2ui5.oViewNest2) {` && |\n| &&
` return;` && |\n| &&
` }` && |\n| &&
` sap.z2ui5.oViewNest2.destroy();` && |\n| &&
` },` && |\n| &&
` ViewDestroy: () => {` && |\n| &&
` if (!sap.z2ui5.oView) {` && |\n| &&
` return;` && |\n| &&
@ -209,6 +234,7 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
` ` && |\n| &&
` onEventFrontend: (...args) => {` && |\n| &&
|\n| &&
custom_js_oneventfrontend &&
` switch (args[0].EVENT) {` && |\n| &&
` case 'LOCATION_RELOAD':` && |\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(sap.z2ui5.oResponse.PARAMS.S_VIEW_NEST.XML);` && |\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| &&
` 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| &&
` 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_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_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| &&
@ -392,6 +423,7 @@ CLASS z2ui5_cl_fw_http_handler IMPLEMENTATION.
|\n| &&
` sap.z2ui5.checkTimerActive = false;` && |\n| &&
` sap.z2ui5.checkNestAfter = false;` && |\n| &&
` sap.z2ui5.checkNestAfter2 = false;` && |\n| &&
|\n| &&
` sap.z2ui5.oBody.OLOCATION = {` && |\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| &&
` sap.z2ui5.oController = oView.getController();` && |\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.oControllerNest2 = oViewNest.getController();` && |\n| &&
` sap.z2ui5.checkLogActive = ` && z2ui5_cl_fw_utility=>boolean_abap_2_json( check_logging ) && `;` && |\n| &&
` sap.z2ui5.oBody = {};` && |\n| &&
` sap.z2ui5.oBody.APP_START = sap.z2ui5.APP_START;` && |\n| &&

View File

@ -14,6 +14,7 @@ INTERFACE z2ui5_if_client
BEGIN OF cs_view,
main TYPE string VALUE `MAIN`,
nested TYPE string VALUE `NESTED`,
nested2 TYPE string VALUE `NESTED2`,
popover TYPE string VALUE `POPOVER`,
popup TYPE string VALUE `POPUP`,
END OF cs_view.
@ -96,9 +97,17 @@ INTERFACE z2ui5_if_client
method_insert TYPE clike
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_model_update.
METHODS nest_view_model_update2.
METHODS cursor_set
IMPORTING