From e72f90d1402d63b8534769229bebbfde746e7d00 Mon Sep 17 00:00:00 2001 From: oblomov <102328295+oblomov-dev@users.noreply.github.com> Date: Wed, 21 Jun 2023 08:05:33 +0200 Subject: [PATCH] focus fix (#297) * refactoring naming * focus * abaplint fix * abaplint fix Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * Update src/z2ui5_cl_http_handler.clas.abap Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * fix * Update src/z2ui5_cl_http_handler.clas.abap Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> --------- Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> --- src/z2ui5_cl_http_handler.clas.abap | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/z2ui5_cl_http_handler.clas.abap b/src/z2ui5_cl_http_handler.clas.abap index b2ff90bd..8bed7aeb 100644 --- a/src/z2ui5_cl_http_handler.clas.abap +++ b/src/z2ui5_cl_http_handler.clas.abap @@ -230,13 +230,22 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION. ` }` && |\n| && ` var oView = sap.z2ui5.oView;` && |\n| && ` try {` && |\n| && - ` if (sap.z2ui5.oResponse.PARAMS.S_CURSOR.ID !== '') {` && |\n| && - ` var ofocus = oView.byId(sap.z2ui5.oResponse.PARAMS.S_CURSOR.ID).getFocusInfo();` && |\n| && - ` ofocus.cursorPos = parseInt(sap.z2ui5.oResponse.PARAMS.S_CURSOR.CURSORPOS);` && |\n| && - ` ofocus.selectionStart = parseInt(sap.z2ui5.oResponse.PARAMS.S_CURSOR.SELECTIONSTART);` && |\n| && - ` ofocus.selectionEnd = parseInt(sap.z2ui5.oResponse.PARAMS.S_CURSOR.SELECTIONEND);` && |\n| && - ` }` && |\n| && - ` oView.byId(sap.z2ui5.oResponse.PARAMS.S_CURSOR.ID).applyFocusInfo(ofocus);` && |\n| && + `jQuery.sap.delayedCall(50, this, function() {` && |\n| && +* `oView.byId(sap.z2ui5.oResponse.PARAMS.S_CURSOR.ID).addEventDelegate({` && |\n| && +* ` onAfterRendering: function(){` && |\n| && + ` var ofocus = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS.S_CURSOR.ID).getFocusInfo();` && |\n| && + ` ofocus.selectionStart = parseInt(sap.z2ui5.oResponse.PARAMS.S_CURSOR.SELECTIONSTART);` && |\n| && + ` ofocus.selectionEnd = parseInt(sap.z2ui5.oResponse.PARAMS.S_CURSOR.SELECTIONEND);` && |\n| && + ` sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS.S_CURSOR.ID).applyFocusInfo(ofocus);` && |\n| && + ` } );` && |\n| && +* `});` && +* ` if (sap.z2ui5.oResponse.PARAMS.S_CURSOR.ID !== '') {` && |\n| && +* ` var ofocus = oView.byId(sap.z2ui5.oResponse.PARAMS.S_CURSOR.ID).getFocusInfo();` && |\n| && +* ` ofocus.cursorPos = parseInt(sap.z2ui5.oResponse.PARAMS.S_CURSOR.CURSORPOS);` && |\n| && +* ` ofocus.selectionStart = parseInt(sap.z2ui5.oResponse.PARAMS.S_CURSOR.SELECTIONSTART);` && |\n| && +* ` ofocus.selectionEnd = parseInt(sap.z2ui5.oResponse.PARAMS.S_CURSOR.SELECTIONEND);` && |\n| && +* ` }` && |\n| && +* ` oView.byId(sap.z2ui5.oResponse.PARAMS.S_CURSOR.ID).applyFocusInfo(ofocus);` && |\n| && ` } catch (error) { }` && |\n| && ` ; try { } catch (error) { }` && |\n| && ` ; if (sap.z2ui5.oResponse.PARAMS.T_SCROLL) {` && |\n| &&