Ajaxify Validation

UI Components for JSF
Post Reply
m.hakci
Posts: 7
Joined: 26 Aug 2010, 14:08

27 Aug 2010, 17:00

Hi everyone;

I've a problem with the fallowing codes;

Code: Select all

<p:panel header="Create a new Tpuser">
			<p:messages id="msg"/>
				<h:panelGrid columns="2" cellpadding="10" id="grid">
					<h:outputText value="Username: " />
					<h:inputText id="username" value="#{tpUserBean.newTpuser.username}">
						<f:validateLength minimum="4" />
						<p:ajax event="blur" update="msg" />
					</h:inputText>
							
					<h:outputText value="Fullname:" />
					<h:inputText value="#{tpUserBean.newTpuser.fullname}"/>
				
					<h:outputText value="Kananame:" />
					<h:inputText value="#{tpUserBean.newTpuser.fullkananame}"/>
							
					<h:outputText value="E-mail:" />
					<h:inputText value="#{tpUserBean.newTpuser.email}"/>
					
					<p:commandButton value="Add a new TPuser" action="#{tpUserBean.reinit}" update="tpUsers">
						<p:collector value="#{tpUserBean.newTpuser}" addTo="#{tpUserBean.tpusers}" />
					</p:commandButton><br/>
					<p:commandButton value="Reset" type="reset"/>
				</h:panelGrid>
			</p:panel>
i wanna do validations without clicking to button but it didn't work.
where is my fault?

callahan
Posts: 768
Joined: 27 May 2010, 22:52

27 Aug 2010, 19:49

Hi,

The validation looks like it should work! If tpUserBean.newTpuser is null, everything will look ok in the browser, but exceptions will be thrown on the server, and you'll see HTTP errors with Firebug. Is this by any chance the case? If not, checkout the ajax requests being sent with Firebug.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 38 guests