viewCodes.xhtml 1.76 KB
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:products="http://java.sun.com/jsf/composite/tools/products" xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:f="http://java.sun.com/jsf/core">
<h:body>
	<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
		<ui:param name="thispage" value="page.gamecode.viewCodes" />
		<f:metadata>
			<f:viewParam name="userid" value="#{userView.userid}" />
			<f:event type="preRenderView" listener="#{gameCodeView.initUserView}" />
		</f:metadata>
		<ui:define name="content">



			<h:form>

				<h:outputLabel rendered="#{gameCodeView.noGameCodes}" value="#{i18n['game.noGameCodes']}" />

				<h:dataTable  rendered="#{not gameCodeView.noGameCodes}" border="1" id="codes" value="#{gameCodeView.gameCodes}" var="code">
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['game.name']}" />
						</f:facet>
						<h:outputText value="#{code.game.name}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['game.description']}" />
						</f:facet>
						<h:outputText value="#{code.game.description}" />
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['gamecode.code']}" />
						</f:facet>
						<h:commandButton rendered="#{not code.accessed}" value="#{i18n['gamecode.open']}" action="#{gameCodeView.openSelectedCode}" />
						<h:outputText rendered="#{code.accessed}"  value="#{code.code}" />
					</h:column>
				</h:dataTable>
			</h:form>

		</ui:define>
	</ui:composition>
</h:body>
</html>