What I want is hide the login and register after user login his account, but it doesn't work. Here is the HTML and JavaScript code.
<div class="u lf " id="checkviewuser">
<span><a id="numero2" href="/RIDOApp/login.xhtml">login</a><b> | </b>
<a id="numero1" href="/RIDOApp/registraction.xhtml">register</a> </span>
</div>
<div class="lf">
<h:outputText value="  Welcome Back, #{userBean.firstName}   "
rendered="#{userBean.isLogin}"/>
<p:commandLink value="logout" rendered="#{userBean.isLogin}" action="#{userBeanController.logout}"/></div>
</div>
<script type="text/javascript">
if (('' + #{userBean.firstName} +0) == 0) {
$("#yhzx").hide();
$("#checkviewuser").show();
}
else {
$("#yhzx").show();
$("#checkviewuser").hide();
}
</script>
Aucun commentaire:
Enregistrer un commentaire