on 09-25-2014 7:53 AM
Hi Friends,
I have a Web Dynpro Java application deployed in our portal 731. This WD app will be accessed from role A, Role B, Role C. End User will be having all three roles assigned. Depending on the role selected, we have to fetch master data from our backend server.
In WD init (), how can we know which role is selected?
I have tried below code and it is listing all the roles assigned to the user and I am unable to track which role he has navigated(selected).
Code:
IUser currentUser = WDClientUser.getCurrentUser().getSAPUse();// identifying current loggedin user
Iterator<String> rolesAssignedToUser = currentUser.getRoles(true);// getting the role list assigened
I want to know from which role he is viewing the current app view and not the list of roles assigned to his user id.
Regards,
Rakesh Mathew
IWDNavigationHelperService wdNavHelperService =
(IWDNavigationHelperService) WDPortalUtils.getService(IWDNavigationHelperService.KEY);
INavigationNode navigationNode = wdNavHelperService.getCurrentNavNode();
String navNode = navigationNode.getName();
add tc/ep/navigation/api as dependency
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Mathew ,
im not aware of finding out the current selected role at runtime , but one solution to your requirement is to have three different pages for role A, role B and role C , so that in the page you can maintain parameters which is accessible at runtime by using the code
WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("");
in the page ,. you have application parameter property there for role a -> page -> add parameter like
CurrentRole=A
and simillary in other pages at role b -> CurrentRole=B
rolec -> CurrentRole = C
in wdDoinit() methods you can use this.
String currentRoleSelected = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("CurrentRole");
make sure that CurrentRole parameter added in the page application parameters , will be case sensitive ,i.,e same name should be used at wdprotcol..... getparameter("parametername added in the page")
Regards
Govardan Raj S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.