Re: [Xsltforms-support] Display two inputs for one field; one readonly the other editable
Brought to you by:
alain-couthures
From: Mark v. d. B. <ko...@gm...> - 2010-05-26 13:02:41
|
Hi Javier, Here is the code illustrating the problem: <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="yes"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xml:lang="nl" lang="nl"> <head> <title>Test</title> <xf:model id="overzicht"> <xf:instance id="selectiescherm"> <root> <item> <value>1</value> </item> <item> <value>2</value> </item> <item> <value>3</value> </item> </root> </xf:instance> <xf:bind nodeset="/root/item/value" readonly="false()" /> </xf:model> </head> <body> <table> <xf:repeat nodeset="/root/item" id="items"> <tr> <td> <strong>This field should be editable:</strong> <xf:input ref="value" /> </td> </tr> </xf:repeat> </table> <hr/> <strong>This field should be readonly:</strong> <xf:input ref="/root/item[position() = index('items')]/value" /> </body> </html> I think that your code is solving not the same problem as mine. Thanks Mark 2010/5/26 Javier Díaz <jd...@ge...>: > > Do you have the complete example? With inputs, binds, and so on. I think we > did something similar, I'm not sure if may help you. > > > <xf:bind > nodeset="/ACT_INTERCONEXION_IP/TRAZADO/POLITICA_INTERCONEXION/INTERCONEXION[*]/pPAI_IP[*]/ID_PPAI_IP" > relevant="true()" required="true()" > readonly="not(compare(instance('estado')/ACCION,'BAJA'))" > constraint="count(../../pPAI_IP[ID_PPAI_IP = current()]) < 2" > type="xsd:string"/> > > We have a xforms with the following binding, and the constraint is activated > only in these elements of the repeat where the xpath assertion is true. In > our case, we get an error message when two elements of the repeat had the > same value. > > I don't know if this is similar with focus event, I hope it may help you. > > Best Regards, > Javier > > Thanks, > > Mark > > ------------------------------------------------------------------------------ > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |