Source

javaee6-blog-tutorial / src / main / webapp / create.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<ui:composition template="/_decorator.xhtml">
	<ui:define name="title">#{i18n.createTitle}</ui:define>
	<ui:define name="heading">#{i18n.createHeading}</ui:define>
	<ui:define name="body">
		<h:form>
			<p:panel id="createPnl" header="#{i18n.newArticle}"
				toggleable="true" closable="false" toggleSpeed="500"
				onCloseUpdate="growl" closeSpeed="2000" onToggleUpdate="growl"
				widgetVar="panel">
				<h:panelGrid columns="3" cellpadding="10">
					<label>#{i18n.title}</label>
					<h:inputText label="Title" id="lblTitle"
						value="#{blogEntryBean.blogEntry.title}" required="true" />
					<h:message for="lblTitle" class="errorMsg"/>
					<label>#{i18n.author}</label>
					<h:inputText label="Author" id="lblAuthor"
						value="#{blogEntryBean.blogEntry.author}" required="true" />
					<h:message for="lblAuthor" class="errorMsg"/>
					<label>#{i18n.content}</label>
					<h:inputTextarea label="Content" id="lblContent"
						value="#{blogEntryBean.blogEntry.content}" required="true" />
					<h:message for="lblContent" class="errorMsg"/>
					<h:commandButton title="#{i18n.save}" value="#{i18n.save}"
						action="#{blogEntryBean.saveBlogEntry()}" />
				</h:panelGrid>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
</html>