Highlighted

XML schema binding

Avatar

30-08-2008

Hi,

when I bind a form to a XML schema, what ever changes to the XML schema like the max length, will it be reflected in the form? Seem like it is not. I have to delete the existing data connection and created a new data connection, and rebind the XML to the form items. What if there is many changes to the XML, all the items will have to be rebinded? Oh...:(

Replies

Highlighted

Avatar

Avatar

_Edgar_van_Waar

Avatar

_Edgar_van_Waar

_Edgar_van_Waar

30-08-2008

When you drag a field from a data-connection (XSD, XML or whatever) it might look like you have put an data-field on your form. You actually create a new form-field, which automatically inherits its type and properties from the related data type AT THAT MOMENT. So any changes to the schema afterwards, wouldn't have any effect on form-fields previously added.



(I can think of lots of reasons, why you don't want to change field's properties automatically. If your schema's changes that often, that might be something to question)



Changes of the underlying schema will be updated properly (so recreate the dataconnection isn't necessary) but you need to update the form fields. By can dragging the fields from the dataconnection to the corresponding form-field you will be prompted what to do with the form-fields properties.
Highlighted

Avatar

02-09-2008

Hi Mike,

Try refreshing the data connection after update. Even if you delete the connection, uncheck the "Remove Bindings.." option, so that your previous bindings will not be removed from form.



Hope helps,

Any enterprise level consultancy, you can contact me.



asiyegunaydin@kgc.com.tr

Asiye
Highlighted

Avatar

Avatar

sunit82

Avatar

sunit82

sunit82

22-11-2010

@ Edgar_van_Waardenburg:

"You actually create a new form-field, which automatically inherits its type and properties from the related data type AT THAT MOMENT"

As quoted above from your reply, do you mean that what type of control is generated for a xml element is defined as type in the schema?

When i make a dataconnection using a schema file(.xsd), all my elements are shown as TextField. While I need some radio buttons and checkboxes etc...

Can i know how to specify the type in schema so that different types of controls can be generated? Below is my schemal defination.

<?

xml version="1.0" encoding="utf-8"?>

<

xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<

xs:element name="form1">

<

xs:complexType>

<

xs:sequence>

<

xs:element maxOccurs="unbounded" name="sub">

<

xs:complexType>

<

xs:sequence>

<

xs:element minOccurs="0" name="GroupTitle" type="xs:string" />

<

xs:element ref="QuestionInfo" minOccurs="0" maxOccurs="unbounded" />

<

xs:element ref="sub" minOccurs="0" maxOccurs="unbounded" />

</

xs:sequence>

</

xs:complexType>

</

xs:element>

</

xs:sequence>

</

xs:complexType>

</

xs:element>

<

xs:element name="sub">

<

xs:complexType>

<

xs:sequence>

<

xs:element minOccurs="0" name="GroupTitle" type="xs:string" />

<

xs:element ref="QuestionInfo" minOccurs="0" maxOccurs="unbounded" />

<

xs:element ref="sub" minOccurs="0" maxOccurs="unbounded" />

</

xs:sequence>

</

xs:complexType>

</

xs:element>

<

xs:element name="QuestionInfo">

<

xs:complexType>

<

xs:sequence>

<

xs:element minOccurs="0" name="SubTYPE" type="xs:string" />

<

xs:element minOccurs="0" name="Question" type="xs:string" />

<

xs:element minOccurs="0" maxOccurs="unbounded" name="item">

<

xs:complexType>

<

xs:attribute name="token" type="xs:string" use="required" />

<

xs:attribute name="uiname" type="xs:string" use="required" />

</

xs:complexType>

</

xs:element>

</

xs:sequence>

</

xs:complexType>

</

xs:element>

</

xs:schema>

Thanx