Hi all, this is my first blog post.
I would try to explain how to set Application Parameters in a web dynpro page and access them in the java code of the application.
I have this scenario: I have two pages that have the same model but two different iView. I want show or not a toolbar depending on the page I am.
After various attempt I found the solution!
Go to the page on the SAP Portal Content:
Open the page, select the Web Dynpro and select Open:
Here go to All properties > Web Dynpro and select Modify Properties:
In Application Parameters insert <name_of_the_parameter>=<value_for_the_webdynpro>
Save the properties.
Now you have to repeat these steps for the second page (in my case the pages are Users and Users’ application, where in one case obn=true and in the other case obn=false).
Now I put in the wdDoInit method of the component controller this code:
IWDProtocolAdapter protAd = WDProtocolAdapter.getProtocolAdapter(); String idreq = protAd.getRequestObject().getParameter("obn"); if (idreq.equals("true")) wdContext.currentUtilsElement().setButtonActionVisibility(WDVisibility.VISIBLE); else if (idreq.equals("false")) wdContext.currentUtilsElement().setButtonActionVisibility(WDVisibility.NONE);
The code sets to visible or not a button in case of which page is open.