Problem with validators and inCell editing

Components, Ajax Framework, Utilities and More.
Post Reply
Posts: 8
Joined: 30 Jul 2009, 02:59

26 Aug 2011, 17:08

Hello everyone!

I'm using PrimeFaces 2.2.1, Mojarra 2.1.0-b11, and GlassFish 3.1.

I'm trying to implement inCell editing, but I'm having some problems getting my validators to work.

The code I'm using is this:

Code: Select all

<p:growl id="detallesGrowl" />
<h:panelGrid id="panelDetalles" width="100%">
	<p:fieldset legend="${msg.comprobanteFiscal_detalles}"
		collapsed="#{facturaEditForm.detailsCollapsed}" toggleable="true"
		<p:dataTable value="#{conceptos}" var="conceptoComprobante"
			<!-- Inicia columna de cantidad -->
			<p:column headerText="${msg.conceptoComprobante_cantidad}">
					<f:facet name="output">
						<h:outputText value="#{conceptoComprobante.cantidad}" />
					<f:facet name="input">
						<p:inputText id="cantidad" required="true" maxlength="20"
							styleClass="auto {mNum: 10, mDec: 0}"
							onfocus="loadAutonumeric()" converter="#{cantidadConverter}">
							<f:validateLongRange minimum="1" />
			<!-- Termina columna de cantidad -->
			<p:column headerText="${msg.conceptoComprobante_importeBruto}">
				<h:outputText value="#{conceptoComprobante.importeBruto}"
					converter="#{importeConverter}" />

			<!-- Inicia columna de descuento -->
			<p:column headerText="${msg.conceptoComprobante_descuento}">
					<f:facet name="output">
						<h:outputText value="#{conceptoComprobante.descuento}"
							converter="#{importeConverter}" />
					<f:facet name="input">						
						<p:inputText id="descuento"
							label="#{msg.conceptoComprobante_descuento}" maxlength="20"
							styleClass="auto {aSign: '$', mNum: 17}"
							onfocus="loadAutonumeric()" converter="#{importeConverter}">
							<f:validateDoubleRange minimum="0.00"
								maximum="#{conceptoComprobante.importeBruto}" />
			<!-- Termina columna de descuento -->
			<p:column id="edit">
				<p:rowEditor />
What I'm trying to do is validate the third column value against the value of the second one. The thid column's value must be bewteen 0.00 and the value of the second column. But when I click the button to close the edit cell mode, the validations says that the value is not between the exptected values of 0.00 and 0.00. I can see the right value being rendered in the second column, but somehow is being evaluated to 0.00 in the validator's maximum value.

Anyone knows how can I make this work? If I can't use validators this way, could I validate the row in the rowEditListener and do not allow the cell edit mode to close until it fulfills the validation?

Hope you can help me.

Thank you!


Post Reply
  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 9 guests