dataTable - action on blur of selected row

UI Components for JSF
Post Reply
sushmasharma79
Posts: 22
Joined: 23 Dec 2009, 20:45

16 Feb 2010, 21:49

Hi,

I have datatable which displays some pre existing data in input texts, which user can modify if wanted. It also displays a row of empty input boxes to add new data. Now the requirement is that once user is finished entering data in one row, I want to update that row in the database. The data should be saved if user enters/changes data into any of the columns of the selected row.

Is there a way to call an action and save the data when the user moves away from the selected row? I mean is there something like "rowBlurEvent", which is fired when user moves on to some other component on the page?

here is my code.

Code: Select all


		<p:dataTable id="nPoints" var="point" value="#{bean.nPoints}"
		width="100%" rows="10" selectionMode="single">
			<p:column>
				<f:facet name="header">
					<h:outputText value="#{bundle['title_tab_n']}" />
				</f:facet>
				<h:inputText id="bmPoint" value="#{point.bmPoint}"  escape="false"/>
			</p:column>
			<p:column>
				<f:facet name="header">
					<h:outputText value="#{bundle['title_tab_p']}" />
				</f:facet>
				<h:inputText id="bpPoint" value="#{point.bpPoint}"  escape="false"/>
			</p:column>
			<p:column>
				<f:facet name="header">
					<h:outputText value="#{bundle['title_tab_z']}" />
				</f:facet>
				<h:inputText id="zPoint" value="#{point.zPoint}"  escape="false"/>
			</p:column>
		</p:dataTable>
what is the easiest and best way to do it?
Thanks,
Sushma
========================================================================================
using Mojarra 1.2_12, facelets, primefaces-1.0.0, tomahawk12-1.1.9, tomcat-6.0.20, jboss-4.2.2GA

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 54 guests