Welcome, John Smith [Logout]
Site Utilities
Login Data 
- Class name: (k-login-data)
- Version: 1.0
-
Tapestry Integration
Indicates logged-in user name and offers logout link.
HTML5 Plain Code
-
<p class="k-login-data">Welcome, <span id="user-name">John Smith</span> [<strong><a href="#">Logout</a></strong>]</p>
CSS Code
-
p.k-login-data {
-
width: 15%;
-
top: 5.1em;
-
right: 4%;
-
font-size: 0.8em;
-
text-align: right;
-
color: #000;
-
padding: 0.8em 0.5em 0 0;
-
border-right: 1px solid #000;
-
}
-
p.k-login-data a, p.k-login-data a:link, p.k-login-data a:visited {
-
}
IE Backward Compatibility
In order to correct display bugs for Internet Explorer versions prior to 9, your html pages need to call the following file by Conditional Comments:
Tapestry Integration
This component do not have a Tapestry Implementation. Here is just an example in order to explain how to implement it in your own project.
The Template
-
<div t:type="if" t:test="loggedUserExists">
-
<p class="k-login-data">
-
Welcome, <span id="user-name">loggedUser?.name</span>
-
[<strong><a t:type="actionLink" t:id="logout">Logout</a></strong>]
-
</p>
-
</div>
Java Implementation
-
@SessionState
-
private User loggedUser;
-
@Property
-
private Boolean loggedUserExists;
-
@OnEvent(value=EventConstants.ACTION, component="logout")
-
public void logout(){
-
-
loggedUser = null;
-
-
}