cancel
Showing results for 
Search instead for 
Did you mean: 

Can't see footer button code but it is visible while running apps

former_member338801
Participant
0 Kudos

Hi Experts,

I have Purchase requisition approval and GRC approval apps are running properly. I have to hide one button in the footer bar. I have downloaded apps but could not see those button code in the footer bar. Am I doing anything wrong?

Then how it is visible in the application. Your help will be really appreciated.

BR,

RK

former_member338801
Participant
0 Kudos

Any thoughts it is little urgent requirment?

former_member338801
Participant
0 Kudos

It is just a requirment to hide share button from PR approval app but the code is not present in the app code.

former_member338801
Participant
0 Kudos

Hi Vaibhav,

Good Morning!

In case of GRC app same code is not working.

There is only controller present to add this code any reason behind? Please suggest.

BR,

RK

mvaibhav
Contributor
0 Kudos

GRC apps is probably designed in a different way.

It might have a different hook method (may be Init) where we might need to modify the footer.

I don't have access to the core GRC App so won't be able to comment on that.

If possible, can you share the original source code (GRC_ACREQ_APR) on GIthub.

Thanks,

Vaibhav

former_member338801
Participant
0 Kudos

Hi Vaibhav,

You can find the requested zip file in the below path.

https://github.com/rkmishra2703/RK-

BR,

RK

mvaibhav
Contributor
0 Kudos

Hi ram,

You will need to override the onInit Method in your extension fro GRC App.

You just need to add the variable bSuppressBookmarkButton : true after the buttonlist array to the existing onInit() method code to hide the button.

Thanks,

Vaibhav Maheshwari

former_member338801
Participant
0 Kudos

Thanks Vaibhav for your kind response.

You mean I have to add suppress button code in extension project but in the extension project onInit function is commented out. Do I need to uncomment and add PR approval code inside init function and comment out rest unused codes?

Please clarify.

BR,

RK

mvaibhav
Contributor
0 Kudos

hi Ram,

I am not very sure on this once.

Try un-comment the init code. Don't paste the PR approval code because the buttons used in both the apps are different.

In the existing code, just add the bSuppressBookmarkButton : true to the Json which is being set other buttons.

You code should look something like this after the change

onInit: function () {
sap.ca.scfld.md.controller.BaseDetailController.prototype.onInit.call(this);
var l = this;
var o = {
sI18NDetailTitle: "ACCESS_REQUEST_LBL",
oPositiveAction: {
sId: "Submit",
sI18nBtnTxt: "SUBMIT_BTN",
onBtnPressed: function (e) {
l.doSubmit();
}
},
oNegativeAction: {
sId: "Forward",
sI18nBtnTxt: "FORWARD_TEXT",
onBtnPressed: function (e) {
l.handleForward(e);
}
},
bSuppressBookmarkButton : true,
onBack: jQuery.proxy(function () {
this.oRouter.navTo("master", {}, false);
}, this),

Thanks,

Vaibhav Maheshwari

Accepted Solutions (1)

Accepted Solutions (1)

mvaibhav
Contributor
0 Kudos

Hi Ram,

Check your S3.Controller.js for the app.

You shoud have the button declared there.

var l = {
oPositiveAction: {
sI18nBtnTxt: t.resourceBundle.getText("XBUT_APPROVE"),
onBtnPressed: jQuery.proxy(t.openApproveRejectDialog, t, ['approve'])
},
oNegativeAction: {
sI18nBtnTxt: t.resourceBundle.getText("XBUT_REJECT"),
onBtnPressed: jQuery.proxy(t.openApproveRejectDialog, t, ['reject'])
},

// Additional Buttons  // Comment if not required
buttonList: [{
sId: "btn_Forward",
sI18nBtnTxt: "XBUT_FORWARD",
onBtnPressed: jQuery.proxy(this.handleForward, t)
}],
onBack: jQuery.proxy(function () {
if (sap.ui.Device.system.phone) {
window.history.go(-1)
}
}, this)

Extend the controller and comment the code for the buttons you don't need.

Thanks,

Vaibhav Maheshwari

former_member338801
Participant
0 Kudos

Hi Vaibhav,

Thanks a lot for your reply.

I couldn't find code for share button highlighted in the screenshot.

Please suggest or let me know if you need whole project to be uploaded to git hub.

BR,

RK

mvaibhav
Contributor
0 Kudos

HI Ram,

If not the whole project, can you at least share the S3 controller and View on GIthub to start with.

Thanks,

Vaibhav Maheshwari

mvaibhav
Contributor
0 Kudos

hi Ram,

In your method, extHookSetHeaderFooterOptions, add the line bSuppressBookmarkButton = true; as mentioned in code below.

   var l = {
                                    oPositiveAction: {
                                                sI18nBtnTxt: t.resourceBundle.getText("XBUT_APPROVE"),
                                                onBtnPressed: jQuery.proxy(t.openApproveRejectDialog, t, ['approve'])
                                    },
                                    oNegativeAction: {
                                                sI18nBtnTxt: t.resourceBundle.getText("XBUT_REJECT"),
                                                onBtnPressed: jQuery.proxy(t.openApproveRejectDialog, t, ['reject'])
                                    },
                                   bSuppressBookmarkButton = true;
                                    onBack: jQuery.proxy(function() {
                                                if (sap.ui.Device.system.phone) {
                                                            window.history.go(-1)
                                                }
                                    }, this)
                        };

Let me know if it helps.

Thanks,

Vaibhav

former_member338801
Participant
0 Kudos

Hi Vaibhav,

Sorry,

It didn't work. I added below code in the said location. Please suggest if any other way is there ti hide share button.

bSuppressBookmarkButton = true;

BR,

RK

mvaibhav
Contributor
0 Kudos

hi Ram,

Please add the following lines at the end of your method.

if (this.extHookChangeFooterButtons) {
l = this.extHookChangeFooterButtons(l);
}

lf the above change doesn't works please share the S3 controller and view code along with the extensions done for the same.

Thanks,

Vaibhav

former_member338801
Participant
0 Kudos

Hi Vaibhav,

I have added projects in the git hub repository. Please check in case of both the projects.

Is there way to hide button using theme designer CSS code?

https://github.com/rkmishra2703/RK-.

BR,

RK

mvaibhav
Contributor
0 Kudos

hi Ram,

Hiding the button using CSS is not a recommended approach and might lead to inconsistencies. So i would suggest to rule that approach out.

For MM_PR_APV app, Extend your 2 controllers ( S3.controller.js and S3_Header.controller.js).

In the extension created for both the controllers, add the following code in the method extHookSetHeaderFooterOptions()

extHookSetHeaderFooterOptions: function(l) {
		var t = this;
		var l = {
			oPositiveAction: {
				sI18nBtnTxt: t.resourceBundle.getText("XBUT_APPROVE"),
				onBtnPressed: jQuery.proxy(t.openApproveRejectDialog, t, ['approve'])
			},
			oNegativeAction: {
				sI18nBtnTxt: t.resourceBundle.getText("XBUT_REJECT"),
				onBtnPressed: jQuery.proxy(t.openApproveRejectDialog, t, ['reject'])
			},
			buttonList: [],
			bSuppressBookmarkButton : true;
			onBack: jQuery.proxy(function () {
				if (sap.ui.Device.system.phone) {
					window.history.go(-1)
				}
			}, this)
		};
		if (this.extHookChangeFooterButtons) {
			l = this.extHookChangeFooterButtons(l)
		}
		this.setHeaderFooterOptions(l)
	 
  }

Please check if this works for PR Approval App. Then it should be similar to GR App.

Thanks,

Vaibhav Maheshwari

former_member338801
Participant

Thanks Vaibhav

Rally thankful to you, I can see change now.I can see along with share button forward button also disappear currently approve and reject button appeared please find attached screenshot. I want forward button to be present there.

screenshot before change

BR,

RK

mvaibhav
Contributor

Hi Ram,

Just add the code in the button list array for FORWARD Button as shown below :

buttonList: [{
sId: "btn_Forward",
sI18nBtnTxt: "XBUT_FORWARD",
onBtnPressed: jQuery.proxy(this.handleForward, t)
}]
Your extension method code would look like this after the change .

extHookSetHeaderFooterOptions: function(l) {
var t = this;
var l = {
oPositiveAction: {
sI18nBtnTxt: t.resourceBundle.getText("XBUT_APPROVE"),
onBtnPressed: jQuery.proxy(t.openApproveRejectDialog, t, ['approve'])
},
oNegativeAction: {
sI18nBtnTxt: t.resourceBundle.getText("XBUT_REJECT"),
onBtnPressed: jQuery.proxy(t.openApproveRejectDialog, t, ['reject'])
},
buttonList: [{
sId: "btn_Forward",
sI18nBtnTxt: "XBUT_FORWARD",
onBtnPressed: jQuery.proxy(this.handleForward, t)
}],
bSuppressBookmarkButton : true;
onBack: jQuery.proxy(function () {
if (sap.ui.Device.system.phone) {
window.history.go(-1)
}
}, this)
};
if (this.extHookChangeFooterButtons) {
l = this.extHookChangeFooterButtons(l)
}
this.setHeaderFooterOptions(l)

  }

Thanks,

Vaibhav Maheshwari

Answers (3)

Answers (3)

mvaibhav
Contributor
0 Kudos

hi Ram,

It would be very difficult to answer your query without looking at the source code, unless someone has encountered the same issue.

Can you share your view and controller code ?

If possible , can you upload the project to Github ?

Thanks,

Vaibhav Maheshwari

saurabh_vakil
Active Contributor
0 Kudos

Check in the controller - most probably there will be function in the controller where footer buttons could be added.

ericci
Active Contributor
0 Kudos

Hi ram mishra, without the source code it's really difficult to answer your question.

former_member338801
Participant
0 Kudos

Hi Ricci,

Please find attached screenshot. I have to hide mentioned action sheet button in PR and GRC approval apps.

BR,

Ram

former_member338801
Participant
0 Kudos

Attached code screenshotss2-xml.pngs3-xml.png

former_member338801
Participant
0 Kudos

Let me know if you need any further details.

BR,

RK

ericci
Active Contributor
0 Kudos

Well the only possible explanation is that their adding those buttons from the Controller (JavaScript) side.

Could you attach the code of the controller? This is really a bad behaviour 😞

former_member338801
Participant
0 Kudos

Really very thankful for your reply.

please find the code in S3.Custon,Controller.js.

In another controller everything is commented out.Let me know if you need any further details.

s3customcontroller-js.txt

ericci
Active Contributor
0 Kudos

this does not seems to be the correct file or at least there's no code about the footer in this Controller's extension

former_member338801
Participant
0 Kudos

How can I find it out. As I said I can't find the code anaywhere but in the runtime it is working mentioned in the screenshot.

BR,

RK