<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
	<f:subview id="messageID">
	<h:form>
		<rich:panel>
			<h:panelGrid columns="2">
				<h:outputText value="1." />
				<h:selectOneMenu id="select1" value="">
					<f:selectItem itemValue="error" itemLabel="error" />
					<f:selectItem itemValue="fatal" itemLabel="fatal" />
					<f:selectItem itemValue="warn" itemLabel="warning" />
					<f:selectItem itemValue="info" itemLabel="info" />
					<f:selectItem itemValue="passed" itemLabel="passed" />
					<f:validator validatorId="MessageValidator" />
				</h:selectOneMenu>

				<h:outputText value="2." />
				<h:selectOneMenu id="select2" value="">
					<f:selectItem itemValue="error" itemLabel="error" />
					<f:selectItem itemValue="fatal" itemLabel="fatal" />
					<f:selectItem itemValue="warn" itemLabel="warning" />
					<f:selectItem itemValue="info" itemLabel="info" />
					<f:selectItem itemValue="passed" itemLabel="passed" />
					<f:validator validatorId="MessageValidator" />
				</h:selectOneMenu>

				<h:outputText value="3." />
				<h:selectOneMenu id="select3" value="">
					<f:selectItem itemValue="error" itemLabel="error" />
					<f:selectItem itemValue="fatal" itemLabel="fatal" />
					<f:selectItem itemValue="warn" itemLabel="warning" />
					<f:selectItem itemValue="info" itemLabel="info" />
					<f:selectItem itemValue="passed" itemLabel="passed" />
					<f:validator validatorId="MessageValidator" />
				</h:selectOneMenu>

				<h:outputText value="4." />
				<h:selectOneMenu id="select4" value="">
					<f:selectItem itemValue="error" itemLabel="error" />
					<f:selectItem itemValue="fatal" itemLabel="fatal" />
					<f:selectItem itemValue="warn" itemLabel="warning" />
					<f:selectItem itemValue="info" itemLabel="info" />
					<f:selectItem itemValue="passed" itemLabel="passed" />
					<f:validator validatorId="MessageValidator" />
				</h:selectOneMenu>

				<h:outputText value="5." />
				<h:selectOneMenu id="select5" value="">
					<f:selectItem itemValue="error" itemLabel="error" />
					<f:selectItem itemValue="fatal" itemLabel="fatal" />
					<f:selectItem itemValue="warn" itemLabel="warning" />
					<f:selectItem itemValue="info" itemLabel="info" />
					<f:selectItem itemValue="passed" itemLabel="passed" />
					<f:validator validatorId="MessageValidator" />
				</h:selectOneMenu>

				<h:outputText value="Rich Message Demo:" />
				<h:selectOneMenu value="#{message.msg}">
					<f:selectItem itemValue="no" itemLabel="no" />
					<f:selectItem itemValue="select1" itemLabel="1" />
					<f:selectItem itemValue="select2" itemLabel="2" />
					<f:selectItem itemValue="select3" itemLabel="3" />
					<f:selectItem itemValue="select4" itemLabel="4" />
					<f:selectItem itemValue="select5" itemLabel="5" />
				</h:selectOneMenu>

				<h:outputText value="Title:" />
				<h:inputText value="#{message.title}" />

				<h:outputText value="Show Detail:" />
				<h:selectBooleanCheckbox value="#{message.showDetail}" />

				<h:outputText value="ShowSummary" />
				<h:selectBooleanCheckbox value="#{message.showSummary}" />

				<h:outputText value="Tooltip" />
				<h:selectBooleanCheckbox value="#{message.tooltip}" />
				
				<h:outputText value="Layout:" />
				<h:selectOneMenu value="#{message.layout}">
					<f:selectItem itemValue="table" itemLabel="table"/>
					<f:selectItem itemValue="list" itemLabel="list"/>
				</h:selectOneMenu>

				<h:commandButton value="submit" />
				<a4j:commandButton value="submit ajax" />
			</h:panelGrid>
		</rich:panel>

		<rich:spacer></rich:spacer>

		<rich:panel>
			<h:outputText value="Rich Message Demo:" />

			<f:verbatim>
				<br />
			</f:verbatim>

			<rich:message for="#{message.msg}" tooltip="#{message.tooltip}"
				showDetail="#{message.showDetail}"
				showSummary="#{message.showSummary}" passedLabel="No Error"
				errorLabelClass="errorLabel" fatalLabelClass="warnLabel"
				infoLabelClass="infoLabel" warnLabelClass="fatalLabel"
				title="#{message.title}">


				<f:facet name="errorMarker">
					<h:graphicImage url="/pics/error.gif" />
				</f:facet>

				<f:facet name="fatalMarker">
					<h:graphicImage url="/pics/fatal.gif" />
				</f:facet>

				<f:facet name="infoMarker">
					<h:graphicImage url="/pics/info.gif" />
				</f:facet>

				<f:facet name="warnMarker">
					<h:graphicImage url="/pics/warn.gif" />
				</f:facet>

				<f:facet name="passedMarker">
					<h:graphicImage url="/pics/passed.gif" />
				</f:facet>
			</rich:message>

			<rich:separator></rich:separator>

			<h:outputText value="Rich Messages Demo" />
			<rich:messages layout="#{message.layout}" tooltip="#{message.tooltip}"
				showDetail="#{message.showDetail}"
				showSummary="#{message.showSummary}" passedLabel="No Error"
				errorLabelClass="errorLabel" fatalLabelClass="warnLabel"
				infoLabelClass="infoLabel" warnLabelClass="fatalLabel"
				warnMarkerClass="markerWarn" infoMarkerClass="markerInfo"
				errorMarkerClass="markerError" fatalMarkerClass="markerFatal"
				errorClass="errorClass" fatalClass="fatalClass"
				warnClass="warnClass" infoClass="infoClass" labelClass="labelClass"
				var="messages" styleClass="class" title="#{message.title}">
				<f:facet name="errorMarker">
					<h:graphicImage url="/pics/error.gif" />
				</f:facet>
				<f:facet name="fatalMarker">
					<h:graphicImage url="/pics/fatal.gif" />
				</f:facet>
				<f:facet name="infoMarker">
					<h:graphicImage url="/pics/info.gif" />
				</f:facet>
				<f:facet name="warnMarker">
					<h:graphicImage url="/pics/warn.gif" />
				</f:facet>
				<f:facet name="passedMarker">
					<h:graphicImage url="/pics/passed.gif" />
				</f:facet>
				<h:outputText value="#{messages.summary}">
				</h:outputText>
			</rich:messages>
		</rich:panel>
	</h:form>
	<h:form>
		<h:commandLink value="Back" action="main"></h:commandLink>
	</h:form>
	</f:subview>

