How to disable global buttons in OA Framework page?

Before starting the post I want to say sorry to everyone as I was very busy with my personal life and was unable to dedicate any time to post any new articles to the blog. But now I am back and will try my level best to keep the posting new articles as frequently as possible.
Moving on to the topic of today, we will discuss how to disable Global Button which appear on an OA Framework page.
This can be a very typical requirement but doing this is still very easy. Disabling all the global buttons that appear on the OA Framework page is easy and the code below will suffice.
Assumptions:
1. You already have a page say XXTrialPG and have a pagelayout region in the page.
2. You have imported all the required classed to the controller say XXTrialCO of XXTrialPG
Let’s understand this in steps.
Step1: Create a handle of the pageLayout Region of your page(XXTrialPG)
OAPageLayoutBean page = (OAPageLayoutBean)pageContext.getPageLayoutBean(); page.prepareForRendering(pageContext);
Step2: Create a handle of the pageLayout Region of your page(XXTrialPG)
OAGlobalButtonBarBean buttons = (OAGlobalButtonBarBean)page.getGlobalButtons();
buttons.setRendered(false);

That’s it 🙂
Happy Learning

Leave a Reply

Your email address will not be published. Required fields are marked *