Feliciano Borrego wrote:
Hi,
The following form model works correctly in cocoon 2.1.7:
<fd:repeater-action id="add-ctrl_proy"
command="add-row"
repeater="ctrl_proys">
<fd:label>XYZ</fd:label>
<fd:on-action>
<fd:javascript>
var form = event.source.form;
var repeater = form.getChild("ctrl_proys");
var dFecha = new java.util.Date();
var wFecha =
event.source.parent.lookupWidget("fecha_ctrl_insert");
if ( wFecha.value != null ) {
dFecha = wFecha.value;
}
... ...
var cProy =
event.source.parent.lookupWidget("proyecto").value;
var stream = new java.io.ByteArrayOutputStream;
cocoon.processPipelineTo( 'sql_horas_reales'
, {proyecto: cProy }
, stream );
var cXml = stream.toString();
... ...
var idxRowNueva = repeater.getSize() - 1;
if ( ValorDuplicadoRepeater( repeater, "fecha_ctrl", dFecha ))
{
wFecha.setValidationError(
new
Packages.org.apache.cocoon.forms.validation.ValidationError
("Fecha Duplicada", false ));
wFecha.setValue( dFecha );
repeater.removeRow( idxRowNueva );
} else {
var repeaterRowNueva = repeater.getRow( idxRowNueva );
repeaterRowNueva.getChild( "_origen" ).setValue( '+' );
wFecha.setValue( null );
}
</fd:javascript>
</fd:on-action>
In Cocoon 2.1.8 the "!" of wFecha.setValidationError is only seen after
the first time.
Hmmm... this may be because of the validation status caching that has
been added to speed up things.
I'll have a look at it.
Sylvain
--
Sylvain Wallez Anyware Technologies
http://bluxte.net http://www.anyware-tech.com
Apache Software Foundation Member Research & Technology Director
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]