Skip to content

Commit

Permalink
fix: use public api´s in sample code for V4 FE (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
marianfoo committed Jun 27, 2023
1 parent 46fbaee commit 55d3f5a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/pages/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ If set to true, it will set the log level to `debug` (Log.Level.DEBUG) and activ
## Example Code with all options

```js
this.excelUpload = await this._controller.getAppComponent().createComponent({
this.excelUpload = await this.getView().getController().getAppComponent().createComponent({
usage: "excelUpload",
async: true,
componentData: {
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ The attribute `context` is mandatory and must be set so the component can access

````javascript
openExcelUploadDialog: async function (oEvent) {
this._view.setBusyIndicatorDelay(0)
this._view.setBusy(true)
this.getView().setBusyIndicatorDelay(0)
this.getView().setBusy(true)
if (!this.excelUpload) {
this.excelUpload = await this._controller.getAppComponent().createComponent({
this.excelUpload = await this.getView().getController().getAppComponent().createComponent({
usage: "excelUpload",
async: true,
componentData: {
Expand All @@ -153,7 +153,7 @@ openExcelUploadDialog: async function (oEvent) {
});
}
this.excelUpload.openExcelUploadDialog()
this._view.setBusy(false)
this.getView().setBusy(false)
}
````

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ or set the [`debug`](Configuration.md#debug) parameter in the initialization of
This is only possible if the component can be opened at all, so please use the url parameter if possible.

```js
this.excelUpload = await this._controller.getAppComponent().createComponent({
this.excelUpload = await this.getView().getController().getAppComponent().createComponent({
usage: "excelUpload",
async: true,
componentData: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ sap.ui.define([], function () {
* @param {*} oEvent
*/
openExcelUploadDialog: async function (oEvent) {
this._view.setBusyIndicatorDelay(0);
this._view.setBusy(true);
this.getView().setBusyIndicatorDelay(0);
this.getView().setBusy(true);
if (!this.excelUpload) {
this.excelUpload = await this._controller.getAppComponent().createComponent({
this.excelUpload = await this.getView().getController().getAppComponent().createComponent({
usage: "excelUpload",
async: true,
componentData: {
Expand Down Expand Up @@ -57,7 +57,7 @@ sap.ui.define([], function () {
}, this);
}
this.excelUpload.openExcelUploadDialog();
this._view.setBusy(false);
this.getView().setBusy(false);
}
};
});
32 changes: 16 additions & 16 deletions examples/packages/ordersv4fe/webapp/ext/ObjectPageExtController.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ sap.ui.define([], function () {
* @param {*} oEvent
*/
openExcelUploadDialog: async function (oEvent) {
this._view.setBusyIndicatorDelay(0);
this._view.setBusy(true);
this.getView().setBusyIndicatorDelay(0);
this.getView().setBusy(true);
if (!this.excelUpload) {
this.excelUpload = await this._controller.getAppComponent().createComponent({
this.excelUpload = await this.getView().getController().getAppComponent().createComponent({
usage: "excelUpload",
async: true,
componentData: {
Expand Down Expand Up @@ -55,13 +55,13 @@ sap.ui.define([], function () {
}, this);
}
this.excelUpload.openExcelUploadDialog();
this._view.setBusy(false);
this.getView().setBusy(false);
},
openExcelUploadDialogTable: async function (oEvent) {
this._view.setBusyIndicatorDelay(0);
this._view.setBusy(true);
this.getView().setBusyIndicatorDelay(0);
this.getView().setBusy(true);
if (!this.excelUploadTable) {
this.excelUploadTable = await this._controller.getAppComponent().createComponent({
this.excelUploadTable = await this.getView().getController().getAppComponent().createComponent({
usage: "excelUpload",
async: true,
componentData: {
Expand All @@ -74,13 +74,13 @@ sap.ui.define([], function () {
});
}
this.excelUploadTable.openExcelUploadDialog();
this._view.setBusy(false);
this.getView().setBusy(false);
},
openExcelUploadDialogTableShipping: async function (oEvent) {
this._view.setBusyIndicatorDelay(0);
this._view.setBusy(true);
this.getView().setBusyIndicatorDelay(0);
this.getView().setBusy(true);
if (!this.excelUploadTableShipping) {
this.excelUploadTableShipping = await this._controller.getAppComponent().createComponent({
this.excelUploadTableShipping = await this.getView().getController().getAppComponent().createComponent({
usage: "excelUpload",
async: true,
componentData: {
Expand All @@ -90,13 +90,13 @@ sap.ui.define([], function () {
});
}
this.excelUploadTableShipping.openExcelUploadDialog();
this._view.setBusy(false);
this.getView().setBusy(false);
},
openExcelUploadDialogTableInfo: async function (oEvent) {
this._view.setBusyIndicatorDelay(0);
this._view.setBusy(true);
this.getView().setBusyIndicatorDelay(0);
this.getView().setBusy(true);
if (!this.excelUploadTableShippingInfo) {
this.excelUploadTableShippingInfo = await this._controller.getAppComponent().createComponent({
this.excelUploadTableShippingInfo = await this.getView().getController().getAppComponent().createComponent({
usage: "excelUpload",
async: true,
componentData: {
Expand All @@ -106,7 +106,7 @@ sap.ui.define([], function () {
});
}
this.excelUploadTableShippingInfo.openExcelUploadDialog();
this._view.setBusy(false);
this.getView().setBusy(false);
}
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ sap.ui.define([], function () {
* @param {*} oEvent
*/
openExcelUploadDialog: async function (oEvent) {
this._view.setBusyIndicatorDelay(0);
this._view.setBusy(true);
this.getView().setBusyIndicatorDelay(0);
this.getView().setBusy(true);
if (!this.excelUpload) {
this.excelUpload = await this._controller.getAppComponent().createComponent({
this.excelUpload = await this.getView().getController().getAppComponent().createComponent({
usage: "excelUpload",
async: true,
componentData: {
Expand All @@ -18,7 +18,7 @@ sap.ui.define([], function () {
});
}
this.excelUpload.openExcelUploadDialog();
this._view.setBusy(false);
this.getView().setBusy(false);
}
};
});

0 comments on commit 55d3f5a

Please sign in to comment.