viewCodes.xhtml 2.22 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"  xmlns:p="http://primefaces.org/ui">
<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']}" />

				<p:dataTable rendered="#{not gameCodeView.noGameCodes}" columnClasses="nowrap,numalign,numalign,nowrap,numalign" styleClass="bordertable" id="codes" value="#{gameCodeView.gameCodes}" var="code">
					<p:column sortBy="#{code.game.service}">
						<f:facet name="header">
							<h:outputText value="#{i18n['game.service']}" />
						</f:facet>
						<h:outputText value="#{code.game.service}" />
					</p:column>
					<p:column sortBy="#{code.game.name}">
						<f:facet name="header">
							<h:outputText value="#{i18n['game.name']}" />
						</f:facet>
						<h:outputText value="#{code.game.name}" />
					</p:column>
					<p:column sortBy="#{code.game.description}">
						<f:facet name="header">
							<h:outputText value="#{i18n['game.description']}" />
						</f:facet>
						<h:outputText value="#{code.game.description}" />
					</p:column>
					<p:column sortBy="#{code.code}">
						<f:facet name="header">
							<h:outputText value="#{i18n['game.code']}" />
						</f:facet>
						<h:outputText rendered="#{not code.accessed}" value="ei avattu" />
						<h:commandButton rendered="#{not code.accessed}" value="#{i18n['game.open']}" action="#{gameCodeView.openSelectedCode}" />
						<h:outputText rendered="#{code.accessed}" value="#{code.code}" />
					</p:column>
				</p:dataTable>
			</h:form>

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