Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problems with DynamicForm rendering of XML data

    Hi,

    We have the DynamicForm class rendering a form based on an XSD schema and populating the form fields via XML. Simple forms are rendered fine, and fields can be validated against the schema. When it comes to rendering more than one item in a list, however, the DynamicForm class only renders (and populates) the first item. An example XSD schema:

    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <!--Created with Liquid XML Studio Developer Edition (Trial) 8.0.9.2074 (http://www.liquid-technologies.com)-->
    <xsd:schema xmlns:isc="http://smartclient.com/XSExtensions" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    	<xsd:element name="dlcConfig">
    		<xsd:complexType>
    			<xsd:sequence>
    				<xsd:element isc:title="User" minOccurs="1" maxOccurs="1" name="user" type="xsd:string" />
    				<xsd:element isc:title="Item" minOccurs="1" maxOccurs="10" name="item" type="itemEntry" />
    			</xsd:sequence>
    		</xsd:complexType>
    	</xsd:element>
    	<xsd:complexType name="itemEntry">
    		<xsd:sequence>
    			<xsd:element isc:title="Quantity" name="quantity" type="xsd:integer" />
    			<xsd:element isc:title="Description" name="description" type="xsd:string" />
    		</xsd:sequence>
    	</xsd:complexType>
    </xsd:schema>
    Some example XML data:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <response>
        <status>0</status>
        <startRow>0</startRow>
        <endRow>1</endRow>
        <totalRows>1</totalRows>
        <data>
            <record>
                <user>John</user>
                <item>
                    <quantity>2</quantity>
                    <description>This is an item</description>
    			</item>
                <item>
                    <quantity>4</quantity>
                    <description>This is also an item</description>
    			</item>
            </record>
        </data>
    </response>
    Are we formatting our data in XML correctly for DynamicForm to render and populate fields correctly?
    Is this a limitation of the DynamicForm class?
    Should we be using something else to render a table based on a schema and then populate from XML?

    Thanks
    Pirow

    #2
    There's a showComplexFields option you can set on DynamicForm to cause it to provide editors for single or multiple complex sub-items.

    You might want to be working with a nightly of 8.0, where this is documented in more detail and there's more built-in behavior (see eg DynamicForm.nestedEditorType).

    Comment

    Working...
    X