on 11-07-2014 11:53 AM
Hi all,
I have solved this problem before with the below code:
Code: |
---|
var username = ''; jQuery.ajax({ url: "/sap/hana/xs/ide/editor/server/dbinfo.xsjs", type: 'GET', dataType: "json", async:false, success: function(data, s, xhr) { if (xhr.getResponseHeader("x-sap-login-page")) { return; } if (data) { username = data.user; } }, }); |
But after that I created a new user which haven't got editor privilage so that this code become useless.
Can anybody help me about showing username on shell?
NOTE: I'm using sap.ui.ux3.Shell.
Hi,
By using shell headeritems, you can assign username.
For more info refer this link Shell Example - SAPUI5 Demo Kit
headerItems: [new sap.ui.commons.TextView({text:UserNameObject,tooltip:"Again Your User Name Object"})],
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't have any idea about your code, also you not shared it.
Assuming you are creating shell, after ajax call. if so follow below steps
1. In Ajax call success event, call createShellFunction and pass userNameObject as parameter.
2. Do shell creating logic in createShellFunction and assign userNameObject to shell by using "headerItems"
Check this link.
http://jsbin.com/kawefu/1/edit?html,js,output
For more info read comments in ajax success event.
I think there is a misunderstanding. Sorry if I'm not clear.
I looked your code you wrote the username by yourself in here:
userName = "UserName";
My problem is not putting the username at the top. I know how to put it there. But my problem is getting the username from the session. I'm using hana login page. I didn't do anything else for login.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.