Hi Alain,

I send it attached to this email.

Regards,
Javier

El 29/6/21 a las 17:42, Alain Couthures escribió:

EXTERNAL EMAIL - Do not click any links or open any attachments unless you 
trust the sender and know the content is safe.

Hi Javier,

It appears to be a dependency issue. As a workaround, adding xforms-build 
action for the select1 control is enough to get expected behavior.

I would like to check with previous XSLTForms releases. Can you please post the 
XForms source for this test case?

Thanks!

--Alain
Le 28/06/2021 20:45, Javier Diazestebaranz(UST, ES) via Xsltforms-support 
<[email protected]><mailto:[email protected]>
 a écrit :


Hi again,

as i told in previous emails, I have updated our xsltforms version from a very 
old one.

After all tests, everything works ok except one form (it doesn't work in 1.5.5 
and 1.5.6 versions).

I attach a simplified form (update_error.html), I don't know if we have 
something wrong in the form or is an xsltforms error.

The problem (it is a bit difficult to explain) is that when you choose a value 
in "select1" component, it triggers the generation of some mandatory input 
elements (3 or 5 in the example), but the bind validations are not executed, so 
although these inputs are defined as required, when I push "Submit", submission 
is done although data is not valid. But when I add an additional parameter with 
'Add' button, apart from adding an additional parameter, validations are 
triggered (all new inputs are marked with error) and in this case when I push 
"Submit", submission it isn't done.

It seems some event is missing to execute after select1 component is modified 
and the actions of 'xforms-value-changed' event are executed.

Best Regards,
Javier
_______________________________________________ Xsltforms-support mailing list 
[email protected]<mailto:[email protected]>
 https://lists.sourceforge.net/lists/listinfo/xsltforms-support

<?xml version="1.0" encoding="iso-8859-15"?>
<?xml-stylesheet href="./xsltforms/xsltforms.xsl" type="text/xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xf="http://www.w3.org/2002/xforms"; xmlns:ev="http://www.w3.org/2001/xml-events";>
  <head>
    <xf:model>
	<xf:instance xmlns="" id="tipo">
	    <data>
		<vct>
		  <elm>3 param</elm>
		  <elm>3</elm>
		</vct>
		<vct>
		  <elm>5 param</elm>
		  <elm>5</elm>
		</vct>
	    </data>
	</xf:instance>
	<xf:instance xmlns="" id="parametro">
	    <data>
		<param/>
	    </data>
	</xf:instance>
	<xf:instance xmlns="" id="initParam">
	    <params>
		<param></param>
	    </params>
	</xf:instance>
	<xf:instance xmlns="" id="datosSalida">
	    <data>
		<primitiva/>
	    </data>
	</xf:instance>
	<xf:instance xmlns="" id="util">
	    <data>
		<numParam/>
		<contador/>
	    </data>
	</xf:instance>
	<xf:bind id="bind_primitivaSalida" nodeset="instance('datosSalida')/primitiva" required="true()" type="xsd:string"/>
	<xf:bind id="bind_listaParametrosSalida" nodeset="instance('datosSalida')/params/param" required="true()" type="xsd:string"/>
	
	<xf:submission id="enviar" method="post" mode="synchronous" ref="instance('datosSalida')" resource="out" validate="false()">
	</xf:submission>
			
     </xf:model>
  </head>
  <body>
	<xf:select1 appearance="minimal" incremental="true" ref="instance('datosSalida')/primitiva">
	    <xf:label>Tipo</xf:label>
	    <xf:itemset nodeset="instance('tipo')/vct">
		<xf:label ref="elm[1]"/><xf:value ref="elm[1]"/>
	    </xf:itemset>
	    <xf:action ev:event="xforms-value-changed">
		    <xf:setvalue ref="instance('util')/numParam" value="instance('tipo')/vct[elm[1] = instance('datosSalida')/primitiva]/elm[2]"/>
		    <xf:delete nodeset="instance('datosSalida')/params"/>
		    <xf:insert nodeset="instance('datosSalida')/primitiva" origin="instance('initParam')"/>
		    <xf:setvalue ref="instance('util')/contador" value="1"/>
		    <xf:action while="instance('util')/contador &lt; instance('util')/numParam">
			<xf:insert at="last()" nodeset="instance('datosSalida')/params/param" origin="instance('parametro')/param"/>
			<xf:setvalue ref="instance('util')/contador" value=". + 1"/>
		    </xf:action>
	    </xf:action>
	</xf:select1>
	<xf:group ref="instance('datosSalida')/params">
	    <xf:repeat id="_params" nodeset="param">
		<xf:input ref=".">
		    <xf:label>Parámetro <xf:output value="position()"/></xf:label>
		</xf:input>
	    </xf:repeat>
	    <xf:trigger appearance="minimal">
		<xf:label>Add</xf:label>
		<xf:action ev:event="DOMActivate">
		    <xf:insert at="last()" nodeset="instance('datosSalida')/params/param" origin="instance('parametro')/param"/>
		</xf:action>
	    </xf:trigger>
	</xf:group>
	<xf:submit submission="enviar">
	    <xf:label>Submit</xf:label>
	</xf:submit>
  </body>
</html>

<<attachment: Javier_DiazEstebaranz.vcf>>

_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support

Reply via email to