I have a set of xml:
<Manifest> <ManifestInformation> <Shipment> <TransportEquipment> <ContainerNumber/> <ServiceCode/> <ContainerType/> </TransportEquipment> </Shipment> </ManifestInformation> </Manifest> Where shipment and TransportEquipment are both repeating items. I want to set the ContainerType as readonly, but only when its value is NC. I tried: <xforms:bind nodeset="instance('instance_model_SeaManifest')/ManifestInformation"> <xforms:bind nodeset="Shipment"> <xforms:bind nodeset="TransportEquipment"> <xforms:bind nodeset ="ContainerNumber" readonly="1" if="ContainerNumber = 'NC'"/> </xforms:bind> </xforms:bind> </xforms:bind> But this only sets it as readonly, ignoring the condition. Any hints as to what I did wrong? |
Chris,
The readonly property takes an XPath expression that evaluates to a boolean. So you would want to use true() as opposed to just 1, but even better, just put readonly=". = 'NC'" and you should be good. (untested) -- Daniel E. Renfer http://kronkltd.net/ On 8/9/07, ChrisSpeare <[hidden email]> wrote: > > I have a set of xml: > > <Manifest> > <ManifestInformation> > <Shipment> > <TransportEquipment> > <ContainerNumber/> > <ServiceCode/> > <ContainerType/> > </TransportEquipment> > </Shipment> > </ManifestInformation> > </Manifest> > > Where shipment and TransportEquipment are both repeating items. I want to > set the ContainerType as readonly, but only when its value is NC. I tried: > > <xforms:bind > nodeset="instance('instance_model_SeaManifest')/ManifestInformation"> > <xforms:bind nodeset="Shipment"> > <xforms:bind nodeset="TransportEquipment"> > <xforms:bind nodeset ="ContainerNumber" readonly="1" > if="ContainerNumber = 'NC'"/> > </xforms:bind> > </xforms:bind> > </xforms:bind> > > But this only sets it as readonly, ignoring the condition. Any hints as to > what I did wrong? -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by ChrisSpeare
Chris,
On 8/9/07, ChrisSpeare <[hidden email]> wrote: > Where shipment and TransportEquipment are both repeating items. I want to > set the ContainerType as readonly, but only when its value is NC. I tried: > > <xforms:bind > nodeset="instance('instance_model_SeaManifest')/ManifestInformation"> > <xforms:bind nodeset="Shipment"> > <xforms:bind nodeset="TransportEquipment"> > <xforms:bind nodeset ="ContainerNumber" readonly="1" > if="ContainerNumber = 'NC'"/> > </xforms:bind> > </xforms:bind> > </xforms:bind> so instead of: <xforms:bind nodeset ="ContainerNumber" readonly="1" if="ContainerNumber = 'NC'"/> You should have something like: <xforms:bind nodeset ="ContainerType" readonly=". = 'NC'"/> Nodeset has to point to the node on which you want to set the "read-onlyness", and readonly is an XPath expression that determines if the node will be read-only or not. Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |