Login Dialog


<xp:this.resources>
	<xp:dojoModule name="dijit.Dialog"></xp:dojoModule>
</xp:this.resources>

<xp:link escape="true" id="banner_btn_login"
	styleClass="loginLink" text="Anmelden">
	<xp:this.rendered>
		<![CDATA[#{javascript:
			var strLoginURL:String;
			var strLogoutURL:String;
			var contextPath = facesContext.getExternalContext().getRequest().getContextPath();
			var requestURI = facesContext.getExternalContext().getRequest().getRequestURI();

			strLoginURL = contextPath + "?login&redirectto=" + requestURI;
			strLogoutURL = contextPath + "?logout&redirectto=" + contextPath;
			return (@UserName() == "Anonymous")?true:false;}]]>
	</xp:this.rendered>
	<xp:eventHandler event="onclick"
		submit="false">
		<xp:this.script><![CDATA[javascript:dijit.byId("#{id:showLoginDialog}").show();]]></xp:this.script>
	</xp:eventHandler>
</xp:link>
<xp:link escape="true" id="banner_btn_logout" styleClass="loginLink"
	value="#{javascript:return strLogoutURL}" text="Abmelden">
	<xp:this.rendered>
		<![CDATA[#{javascript:
			return (@UserName() == "Anonymous")?false:true;}]]>
	</xp:this.rendered>
</xp:link>

<xp:div dojoType="dijit.Dialog" id="showLoginDialog"
	style="overflow:auto;" title="Anmelden">
	<xp:this.dojoAttributes>
		<xp:dojoAttribute name="href"
			value="#{javascript:strLoginURL}" />
	</xp:this.dojoAttributes>
</xp:div>
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
No comments yetLogin first to comment...