try {
writer.append(JSFileReader.getFileStringByName(JSFileName.OVERDUE_INVOICE_EXECUTE_ACTION_CLEANUP));
} catch (IOException e) {
;
}
sap.ui.core.Control.prototype.invalidateOverdueInvoiceTable = function(oEvent, oData) {
// console.log("invalidateOverdueInvoiceTable triggered");
// set OverdueInvoiceTable to an empty array
sap.ui.getCore().byId("formView").getModel("bo").oData.attributes.OverdueInvoiceTable.items = new Array();
// trigger the regular call of the FormController
sap.ui.getCore().byId("formView").getController().executeAction(oEvent, oData);
}
function switchEvent(objectReference, eventName) {
if (null != objectReference) {
// get references of old event
var existingOData = null;
var existingOListener = null;
if (eventName === 'press') {
existingOData = objectReference.mEventRegistry.press[0].oData;
existingOListener = objectReference.mEventRegistry.press[0].oListener;
} else if (eventName === 'change') {
existingOData = objectReference.mEventRegistry.change[0].oData;
existingOListener = objectReference.mEventRegistry.change[0].oListener;
}
// remove old event function and add new event function
if (eventName === 'press') {
objectReference.mEventRegistry = new Array();
objectReference.attachPress(existingOData,sap.ui.core.Control.prototype.invalidateOverdueInvoiceTable,existingOListener);
} else if (eventName === 'change') {
objectReference.mEventRegistry = new Array();
objectReference.attachChange(existingOData,sap.ui.core.Control.prototype.invalidateOverdueInvoiceTable,existingOListener);
}
}
}
function isAlphaNumeric(charCode) {
if ((charCode > 47 && charCode < 58) || // numeric (0-9)
(charCode > 64 && charCode < 91) || // upper alpha (A-Z)
(charCode > 96 && charCode < 123)) { // lower alpha (a-z)
return true;
}
return false;
}
function escapeTechnicalName(technicalName) {
if(null === technicalName) return null;
var tempTechnicalName = "";
for (i = 0; i < technicalName.length; i++) {
if(isAlphaNumeric(technicalName.charCodeAt(i))) {
tempTechnicalName = tempTechnicalName.concat(technicalName.charAt(i));
} else {
tempTechnicalName = tempTechnicalName.concat(technicalName.charCodeAt(i));
}
}
return tempTechnicalName;
}
function findUI5ControlIdViaUI5Registry(technicalName) {
var theEscapeTechnicalName = escapeTechnicalName(technicalName);
var regExpString = "[a-zA-Z]*_"+theEscapeTechnicalName+"\\d{0,100}";
regExp = new RegExp(regExpString);
// search in Element registry all potential UI5 controls
var ui5Controls = sap.ui.core.Element.registry.filter(checkElement);
if (ui5Controls.length === 1) {
// in case there is only one UI5 control return it
return ui5Controls[0].sId;
} else {
// in case more than one UI5 control was found check it in detail
for (i = 0; i < ui5Controls.length; i++) {
var matchResult = ui5Controls[i].sId.match(regExp);
// additionally check if there are addition parts inside of the sId after e.g. <tf_Test95GpsId025151> like <-content> or <-inner>, etc.
// if not deltaLengthCompare should be 0, hint: length calculation only possible if matchResult != null
var deltaLengthCompare = (matchResult != null) ? ui5Controls[i].sId.length - matchResult.toString().length : null;
if(matchResult != "undefined" && matchResult != null && deltaLengthCompare === 0) {
return ui5Controls[i].sId;
}
}
return null;
}
}
function checkElement(oElement, sID) {
if (!oElement.sId.startsWith("lb") && !oElement.sId.startsWith("__") && oElement.sId.match(regExp)) {
return true;
}
return false;
}
// input fields
var tf_GpsId = sap.ui.getCore().byId(findUI5ControlIdViaUI5Registry("Test_GpsId"));
switchEvent(tf_GpsId, "change");
// drop downs
var dd_SenderSID = sap.ui.getCore().byId(findUI5ControlIdViaUI5Registry("Test_SenderSID"));
switchEvent(dd_SenderSID, "change");
var dd_RelevantUser = sap.ui.getCore().byId(findUI5ControlIdViaUI5Registry("OverdueInvoice_RelevantUser"));
switchEvent(dd_RelevantUser, "change");
var dd_DomainSelection = sap.ui.getCore().byId(findUI5ControlIdViaUI5Registry("OverdueInvoice_DomainSelection"));
switchEvent(dd_DomainSelection, "change");
// buttons
var btn_Refresh = sap.ui.getCore().byId(findUI5ControlIdViaUI5Registry("Filter_RefreshButton"));
switchEvent(btn_Refresh, "press");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
24 | |
11 | |
11 | |
8 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 |