|
I am in a situation where I have an XML document that has a set of 'optional/mandatory' fields, so I can pass in a very simple document and this will validate.
The document can then have extra XML elements added to it to expand the functionality of the document, these elements cannot be empty, therefore when the are added as empty they become invalid. Example: Load the xForm with simple instance XML: User now wants to add notification emails, so adds the NotifyEmail element with a add button: The above is invalid is the notfiyemail is blank, but that is ok as the user can now edit this field. I can use a insert to insert into the UserInformation block, however how can I add it after the SenderEmail element? Present insert:
|
|
I would do the following on insert <xforms:insert ev:event="DOMActivate" context="instance('instance_model_Manifest')/UserInformation" position="after" nodeset="SenderEmail" at="last()" origin="instance('NotifyEmail')"/>HTH Ryan Ryan Puddephatt "Measuring programming progress by lines of code is like
measuring aircraft building progress by weight." - Bill Gates ChrisSpeare wrote: I am in a situation where I have an XML document that has a set of 'optional/mandatory' fields, so I can pass in a very simple document and this will validate. The document can then have extra XML elements added to it to expand the functionality of the document, these elements cannot be empty, therefore when the are added as empty they become invalid. Example: Load the xForm with simple instance XML: <UserInformation> -- 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 |
|
Excellant! Thanks Ryan, had been mulling how that was going to happen.
Next question. The notifyemail can have more than one occurance (0 - 2 to be exact), as such needs to feature in a repeat, is it possible to make the repeat reference this element. Thanks again
|
|
Chris, Excellant! Thanks Ryan, had been mulling how that was going to happen. Next question. The notifyemail can have more than one occurance (0 - 2 to be exact), as such needs to feature in a repeat, is it possible to make the repeat reference this element. What element? the current repeat context? Ryan Thanks again Ryan Puddephatt wrote: -- 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 |
|
Ryan,
Thanks for the response but after scratching my head head for a second I realised I could make the button do the job by switching the nodeset based on the count of the number of elements. So sorted Thanks for you help, was a real worrier that one.
|
| Free forum by Nabble | Edit this page |
