@UserName for Hide/When in an Xpage

Mindwatering Incorporated

Author: Tripp W Black

Created: 12/09/2011 at 10:47 PM

 

Category:
Notes Developer Tips
XPages

Issue:
Need XPage equivalent for @Formula:
@LowerCase(@UserName)="Anonymous"

Solution:
if(@LowerCase(@UserName(0)) == 'anonymous') {
"false";
} else {
"true";
}

Solution 2:
Use the new JavaScript application/session objects:
var curuser = session.getEffectiveUserName();
if (curuser.toLowercase == 'anonymous') {
false;
} else {
true;
}

or

curuser.toLowercase == 'anonymous';


Note:
Frustrated your "visible". Although it says "true" in the source you want true the booleon as the returned value.
Also, notice that @UserName(0) is an array which you want the first value.





previous page