{
"name": "SAC OnInitialization",
"description": "SAC OnInitialization Avoid CW",
"eula": "EULA",
"vendor": "jmlds",
"license": "1.0",
"id": "com.sap.jmlds.oninitialization.widget",
"newInstancePrefix": "SACOnInitializationAvoidCW",
"version": "1.0.0",
"icon": "",
"webcomponents": [
{
"kind": "main",
"tag": "com-sap-jmlds-oninitialization-main",
"url": "https://myserver.com/tools/performance/sacperf_main.js?ver=1.0.2",
"integrity": "" ,
"ignoreIntegrity": true
},
{
"kind": "builder",
"tag": "com-sap-jmlds-oninitialization-bp",
"url": "https://myserver.com/tools/performance/sacperf_bp.js?ver=1.0.1",
"integrity": "",
"ignoreIntegrity": true
}
],
"properties": {
"width": {
"type": "integer",
"default": 50
},
"height": {
"type": "integer",
"default": 20
},
"method": {
"type": "string",
"description": "Method",
"default": "onInitialization"
}
},
"methods": {
"clear": {
"description": "Clear the resultset"
}
},
"events": {
"onClick": {
"description": "Only for Visible Process Click"
}
}
}
(function() {
let base = document.createElement("template");
base.innerHTML = `
<form id="frmSacPerf">
<fieldset>
<legend>Method Call</legend>
<table>
<tr>
<td>Name of the Method</td>
<td><input id="id_method" type="text" size="20" maxlength="25"></td>
</tr>
</table>
<input type="submit" style="display:none;">
</fieldset>
</form>
<style>
:box {
display: block;
padding: 1px 1px 1px 1px;
}
</style>
`;
class PanelSacPerf extends HTMLElement {
constructor() {
super();
this._shadowRoot = this.attachShadow({mode: "open"});
this._shadowRoot.appendChild(base.content.cloneNode(true));
this._shadowRoot.getElementById("frmSacPerf").addEventListener("submit", this._submit.bind(this));
}
_submit(e) {
e.preventDefault();
this.dispatchEvent(new CustomEvent("propertiesChanged", {
detail: {
properties: {
method: this.method
}
}
}));
}
set method(setMethod) {
this._shadowRoot.getElementById("id_method").value = setMethod;
}
get method() {
return this._shadowRoot.getElementById("id_method").value;
}
}
customElements.define("com-sap-jmlds-oninitialization-bp", PanelSacPerf);
})();
(function () {
let template = document.createElement('template');
template.innerHTML =
`<button type="button" id="myBtn">SACOnInitializationAvoidCW</button>` ;
class SacPerf extends HTMLElement {
constructor() {
super();
this.init(this);
}
init(e) {
console.log("...Init");
let shadowRoot = this.attachShadow({mode: "open"});
shadowRoot.appendChild(template.content.cloneNode(true));
this.addEventListener("click", event => {
var event = new Event("onClick");
this.fireOnClick();
this.dispatchEvent(event);
});
}
onCustomWidgetBeforeUpdate(changedProperties)
{
}
onCustomWidgetAfterUpdate(changedProperties)
{
if ("method" in changedProperties) {
this.$method = changedProperties["method"];
window.postMessage(this.$method,"https://mytenant.eu10.hcs.cloud.sap");
}
}
connectedCallback()
{
var msg="connectedCallback";
//window.postMessage(msg,"https://mytenant.eu10.hcs.cloud.sap");
}
fireOnClick() {
console.log("OnClick Triggered");
}
}
customElements.define('com-sap-jmlds-oninitialization-main', SacPerf);
})();
switch(message){
case "onInitialization_1":
StartTime = Date.now();
console.log("#### Load App... ####");
Application.showBusyIndicator("Loading...");
SCRO_Utils.pauseRefresh(true);
SCRO_Utils.funcFillSalesMCombo();
break;
case "onInitialization2":
StartTime = Date.now();
console.log("#### Load App... ####");
Application.showBusyIndicator("Loading...");
SCRO_Utils.pauseRefresh(true);
SCRO_Utils.funcFillSalesMCombo();
console.log("#### Initialization 2 ####");
SCRO_Utils.funcFillLocateCombo();
SCRO_Utils.funcFillDateCombo();
console.log("#### Initialization 3 ####");
SCRO_Utils.pauseRefresh(false);
if(varFunctionsCompleted>=5){
Panel_1.setVisible(true);
Application.hideBusyIndicator();
Chart_6.getForecast().setType(ForecastType.Auto);
Chart_11.getForecast().setType(ForecastType.Auto);
EndTime = Date.now();
console.log("#### App Finished. Time Taken=" + (Math.floor((EndTime-StartTime)/1000)).toString());
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
14 | |
10 | |
7 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 |