Expand my Community achievements bar.

XML Schema binding - dynamic form

Avatar

Former Community Member
I am new to Designer and XML. I have been given a basic interactive form and have persevered for a couple of (often frustrating) weeks to extend its functionality to link to an xml schema and provide for dynamic record creation. Unfortunately I am still having problems when adding new instances of subforms.<br /><br />I have a main form for reporting issues. Underneath it there are major components on a subform (can be multiple major components for each issue) and under major components are sub-components (can be multiple sub-components for each major component) on a child subform of major. I can add and delete instances of the subforms for both levels of records.<br /><br />I have created an xml schema based on the form since it already existed, and so the form fields have not inherited properties from the schema. However, I have bound the fields in the form to the xml fields through a data connection. The schema basically looks as follows (bot not literally the same as you will see from the tags):<br /><br /><element complextype issue><br /> <element issueId string/><br /> ...<br /> ...<br /> <element complextype majorcomponent unbounded><br /> <element majcomponentname string/><br /> ...<br /> <element complextype subcomponent unbounded><br /> <element subcomponent string/><br /> <element quantity string/><br /> ...<br /> ...<br /> </element><br /> </element><br /></element><br /><br />My problem is as follows: <br /><br />When I add an instance of a sub-component or major component subform, the first new instance appears to work correctly. However, every subsequent one inherits the values of the previous record and when it is changed, it changes the values of existing fields of the same name but of a different node. When I change each element in the xml schema to "unbounded", the forms appear to work properly but the values are then not nested correctly in the outputted xml data file (many records will appear under one sub-component, for example, when a new sub-component should be added for each).<br /><br />I suspected my problem might be that the "unbounded" property in the schema of the major component and sub-component elements are not linked to the Designer form because the major component and sub-component subforms are not bound to the xml schema. The reason they are not bound is because if I bind the subform, the first element, major/sub component name as applicable, loses its binding.<br /><br />I am sorry if this doesn't make any sense but I am hoping that someone might recognise the problem I am talking about as it is really creating much bother.<br /><br />Thanks.
2 Replies

Avatar

Former Community Member
George_Hickey@adobeforums.com wrote:

> The reason they are not bound is because if I bind the subform, the first element, major/sub

component name as applicable, loses its binding.

>



Your subforms must be bound to the schema for this to work correctly. When you say that the first

element "loses its binding", what do you mean by this? You should see the binding change from a

"full path" to a "relative path", but you should not be losing the binding altogether.



--

Justin Klei

Cardinal Solutions Group

www.cardinalsolutions.com

Avatar

Former Community Member
Thanks Justin for the reply. Unfortunately I can't explain exactly what was happening because I didn't keep sufficient notes and now the form is behaving differently. You are right in that when I bind the subform to the xml schema element, child fields do change their bindings from a full to a relative path. I had seen this before on all except the first field on a subform, which had losts any binding reference at all.



I finally gave up on the schema and bound the forms to sample xml data. This fixed my problem. Now (several days later), I have revisited the problem and deleted my data connection to the xml file to connect to the schema once again. I am quite sure I have not changed the schema at all, nor the form, but for some reason it now appears to work correctly.



I will continue to work with it, once again but thanks very much for your interest.