on 05-16-2008 1:37 PM
Hi all,
how can I get the language of the current user?
Normally I got it with:
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);
IResourceContext resourceContext = new ResourceContext(ep5User);
String strUserLanguage = resourceContext.getLocale().getLanguage();
But this only works in web dynpro applications. Now I need to get the language in my own property renderer. The code throws:
com.sap.tc.webdynpro.services.sal.um.api.WDUMException: No client user defined for the current request (no regular Web Dynpro request as ITask is null.
Thanks a lot
Steffi
Hi,
If you are in a property renderer you always have a IResource which inturn has a ResourceContext and ResourceContext has the Users object.
So the code should be:
IResourceContext resourceContext = IResource.getContext();
IUser user = resourceContext.getUser();
user.getLocale().getLanguage();
Regards,
Praveen Gudapati
Edited by: Praveen Gudapati on May 16, 2008 2:54 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.