Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

* dragging and dropping controls from the designer palette
* creating a form from an XML schema. In this case, the controls will be automatically created for you based on the XML schema definitions.
 
When working with the database connector, you will always used the latter and create the controls from the schema. In the future we intend to relax this requirement.=====

Generating the XML schema

...

You can use the database connector to generate the schemas you will need to use in the frevvo form. 
 
To fetch the schema, type a URI in the browser that looks like the example below.  This is almost identical to the query we used to test the connector, but it tells the connector to GET the schema instead.

...

You should get an XML schema similar to the following:

Code Block

...

 

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.frevvo.com/database/customers" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.frevvo.com/database/customers">
  <xsd:element name="customers">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element maxOccurs="unbounded" name="row">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="customerId">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:maxLength value="11"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
              <xsd:element minOccurs="0" name="firstname">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:maxLength value="50"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
              <xsd:element minOccurs="0" name="lastname">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:maxLength value="50"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>
</pre>

Save the schema as an .xsd file in your file system.  You can then [[V4_Data_Sources_and_Schemas#Uploading_a_Schema | upload the schema]] to frevvo and generate controls from the schema elements that map to your database tables.  If you have multiple queries in your configuration file, you’ll need to generate a schema for each query.

...

[[Image:18px-Attention_niels_epting.svg.png]] '''NOTE:''' Avoid using message control inside of a section that contains other controls that you may want to set to required/not required (either via the Forms Designer or using [[V4_Business_Rules | business rules]]). Since a message control always contains a value, it can cause a section, or other controls in a section, to become required. If you must include a message control, place it outside the section. Another alternative is to write rules for the individual controls within a section to set them to visibile/invisibile or required/not required.