Versions Compared

Key

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

 allows

Table of Contents

frevvo allows you to generate forms automatically based on one or more pre-existing XML schemas. This enables you to quickly create forms that align with your databases, web services, BPM system, and key business applications.

Tip

For practical examples of this approach please refer to Creating a Form Connected to your Database.

In general,  can  frevvo can be created via two different methods:

...

It's very common and easy to create your form by dragging and dropping controls from from frevvo' control palette to the form canvas. As you do this automatically frevvo automatically creates an XSD description of your form's controls. You can download this XSD from the Forms and Workflows Home Page. This method is typically used when your forms do not need to integrate with a back end system.

You can mix and match these two approaches of form creation. You can create all the controls in your form from XML schema elements. You can create all the controls in your form from the  palettethe frevvo palette. Or you can create part of the form from schema elements and part from palette controls that have no relation to the elements in your schema.

...

When you upload a schema to frevvo, you can use any and all global elements in the schema. If you want items from the schema that are not global elements, edit the schema and make the items global elements before uploading the schema to frevvo

At a high level, when you work with schemas you do the following:

  • Upload your schema to one of your  projectsfrevvo projects
  • Choose the global elements you want and add them to your form’s Data Sources 
  • Generate form controls from the global elements you added 
  • Modify the controls (if necessary) to suit your form

These steps are discussed in detail below.

"form" Schema

...

Form Schema

frevvo automatically generates an XSD schema representation of your form as you drop controls from the  palette the frevvo palette to the form designer canvas. You can download this XSD by selecting Download Schema from the Action Menu on the Forms and Workflow Homepage. The XSD elements are named after the control names. The types are based on which control you selected from the palette. For example a Quantity control will appear as an xsd:integer. A dropdown will be an xsd:simpleType restriction. Controls with patterns such as the Zip will have an auto-generated type with your pattern. Click "expand Source" for an example.

Expand
titleClick here for an example


Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.frevvo.com/schemas/_0LaA4HRREeGXK6NO-8HLWA"
            xmlns:frevvo="http://www.frevvo.com/appinfo"
            targetNamespace="http://www.frevvo.com/schemas/_0LaA4HRREeGXK6NO-8HLWA">
   <xsd:element name="CompanyInfo" type="CompanyInfoType">
      <xsd:annotation>
         <xsd:appinfo>
            <frevvo:displaytype/>
         </xsd:appinfo>
      </xsd:annotation>
   </xsd:element>
   <xsd:complexType name="CompanyInfoType">
      <xsd:sequence>
         <xsd:element name="CustomerInformation" type="CustomerInformationType">
            <xsd:annotation>
               <xsd:appinfo>
                  <frevvo:displaytype>Section</frevvo:displaytype>
                  <frevvo:label>Customer Information</frevvo:label>
               </xsd:appinfo>
            </xsd:annotation>
         </xsd:element>
      </xsd:sequence>
   </xsd:complexType>
   <xsd:complexType name="CustomerInformationType">
      <xsd:sequence>
         <xsd:element minOccurs="0" name="CompanyName" type="xsd:string">
            <xsd:annotation>
               <xsd:appinfo>
                  <frevvo:displaytype>Text</frevvo:displaytype>
                  <frevvo:label>Company Name</frevvo:label>
               </xsd:appinfo>
            </xsd:annotation>
         </xsd:element>
         <xsd:element minOccurs="0" name="Revenue">
            <xsd:annotation>
               <xsd:appinfo>
                  <frevvo:displaytype>Money</frevvo:displaytype>
                  <frevvo:label>Revenue</frevvo:label>
               </xsd:appinfo>
            </xsd:annotation>
            <xsd:simpleType>
               <xsd:restriction base="xsd:double"/>
            </xsd:simpleType>
         </xsd:element>
         <xsd:element minOccurs="0" name="Employees">
            <xsd:annotation>
               <xsd:appinfo>
                  <frevvo:displaytype>Quantity</frevvo:displaytype>
                  <frevvo:label>Employees</frevvo:label>
               </xsd:appinfo>
            </xsd:annotation>
            <xsd:simpleType>
               <xsd:restriction base="xsd:decimal">
                  <xsd:pattern value="[\-+]?[0-9]+"/>
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
         <xsd:element minOccurs="0" name="IncorporationDate" type="xsd:date">
            <xsd:annotation>
               <xsd:appinfo>
                  <frevvo:displaytype>Date</frevvo:displaytype>
                  <frevvo:label>Incorporation Date</frevvo:label>
               </xsd:appinfo>
            </xsd:annotation>
         </xsd:element>
         <xsd:element minOccurs="0" name="State" type="StateType">
            <xsd:annotation>
               <xsd:appinfo>
                  <frevvo:displaytype>Dropdown</frevvo:displaytype>
                  <frevvo:label>State</frevvo:label>
                  <frevvo:itemLabel>CT</frevvo:itemLabel>
                  <frevvo:itemLabel>MA</frevvo:itemLabel>
                  <frevvo:itemLabel>NY</frevvo:itemLabel>
               </xsd:appinfo>
            </xsd:annotation>
         </xsd:element>
         <xsd:element minOccurs="0" name="Zip">
            <xsd:annotation>
               <xsd:appinfo>
                  <frevvo:displaytype>Text</frevvo:displaytype>
                  <frevvo:label>Zip</frevvo:label>
               </xsd:appinfo>
            </xsd:annotation>
            <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                  <xsd:pattern value="\d{5}|\d{5}-\d{4}"/>
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
         <xsd:element minOccurs="0" name="Phone">
            <xsd:annotation>
               <xsd:appinfo>
                  <frevvo:displaytype>Phone</frevvo:displaytype>
                  <frevvo:label>Phone</frevvo:label>
               </xsd:appinfo>
            </xsd:annotation>
            <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                  <xsd:pattern value="\d{3}-\d{4}"/>
                  <xsd:pattern value="\d{3}\.\d{4}"/>
                  <xsd:pattern value="\d{3}-\d{3}-\d{4}"/>
                  <xsd:pattern value="\d{3}\.\d{3}\.\d{4}"/>
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
      </xsd:sequence>
   </xsd:complexType>
   <xsd:simpleType name="StateType">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="CT"/>
         <xsd:enumeration value="MA"/>
         <xsd:enumeration value="NY"/>
      </xsd:restriction>
   </xsd:simpleType>
</xsd:schema>
Excerpt



Generating

...

an XML

...

You can use the database connector to generate the schemas you will need to use in your  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.

Code Block
languagetext
http://<host>:<port>/database/<queryset name>/<query name>/schema?<template name>=<template value>

If your SQL Retrieve statement includes template variables, you’ll need to add the variable names as shown below. The schema itself does not require variables but the connector fetches the schema the same way it fetches data for the retrieve statement, so the connector expects the template names and values in the URI.

For the example we've been using so far, point your browser to the url: http://localhost:8082/database/BIRT/allCustomers/schema?customerNumber=237

You should get an XML schema similar to the following:

Code Block
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns="http://www.frevvo.com/database/allCustomers" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.frevvo.com/database/allCustomers">
  <xsd:annotation>
    <xsd:appinfo xmlns:f="http://www.frevvo.com/database/" f:connectorVersion="2.5.3-r30969" f:digest="4f2c46033e8ff5a221ab7106c4003833157e7f6a" f:last-modified="Sat Aug 19 19:06:45 EDT 2017" source="http://www.frevvo.com/database/"/>
  </xsd:annotation>
  <xsd:element name="allCustomers">
    <xsd:annotation>
      <xsd:appinfo xmlns:f="http://www.frevvo.com/database/" f:autoCreate="true" f:autoDelete="false" f:enabled="true" source="http://www.frevvo.com/database/"/>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element maxOccurs="unbounded" minOccurs="0" name="row">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="customerNumber" type="xsd:int"/>
              <xsd:element name="customerName">
                <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>
Note

The f:connectorVersion="2.5.3-r30969 attribute in the above example reports the version of the Database Connector that was used to generate the schema. The f:last-modified="Sat Aug 19 19:06:45 EDT 2017 attribute reports the date/time of the last modification to your configuration.xml file. These attributes will help you manage xsd changes.

Save the schema as an .xsd file in your file system. 

Note

Your schema may not work correctly if you generated the schema in the Chrome browser and then used the Select All, copy/paste function to create the xsd file. Use the Save Page As function instead.

You can then upload the schema to  and generate controls from the schema elements that map to your database tables.  If you have multiple queries in your configuration file, you have two options:

  1. Generate the schemas for an entire queryset.  When there are a large number of queries in the configuration.xml, getting the schemas for all of them eliminates having to create a schema one by one for each query. The queryset schema can be uploaded to your project one time and then you can add the relevant schema elements to your forms/workflows as you need them.

    Code Block
    http://<server>:<port>/database/BIRT/schema
  2. Generate a schema for each query.

    Code Block
    http://<server>:<port>/database/BIRT/allCustomers/schema
Tip

The word "schema" is a reserved word for query names. If you have a query in your configuration.xml with a name that includes the word "schema"  will show an error.

Using Your Schema

Before you can use global elements from a schema in a form, you must upload the schema XSD file into one of your  projects. To upload a schema:

  1. From the Projects page, click the name of the project with the forms that will use the schema.
  2. Click Schemas from the left-hand menu.
  3. From the Schemas page, click the Image RemovedAdd icon.
    Image Removed
  4. On the Upload Schema Page, type a meaningful name for your schema and provide a description. (These are optional but highly recommended.) The Name and Description are each limited to 255 characters.
  5. Click Browse, locate the schema XSD file or zipfile with multiple related XSDs on disk.
  6. If there are multiple global elements in the zipfile(s) specify exact name (relative to the top level directory separated by the '/' character of the XSD file containing the root schema.
  7. Click Upload.

If your schema is valid, its name now will appear on the Schemas page. You canImage Removed sort the Schemas list alpahbetically (A-Z or Z-A). If you tried to upload an invalid schema,   will not allow the upload and display an error message.

Tip

Important notes about uploading schemas:

  1. You may add as many schemas as you require; however, you cannot have two or more data sources in your project with the same root element name.
  2. You may use global elements from uploaded schemas in any and all forms in the project.
  3. If you want to use the same schema elements in multiple projects, upload the schema to each project separately.   
  4. If your schema references another schema, you must upload all related schemas in a single zipfile.
  5. If you upload a zipfile all the schemas in the zipfile must be related.
  6. If you have unrelated schemas you must upload them individually or alone in their own zipfile.
Note

If you add a data source (XSD) to your form/workflow that has the root element name "form" that  uses by default for the palette control XSD, you will see an application error. To resolve, edit the form or workflow "Element Name" property and change it from the default "form" to whatever you want to call it.

Adding Elements to a Form’s Data Sources

Once you’ve uploaded your schema, the next step is to choose the global elements you want for a particular form. The elements you choose will be displayed in the form’s Data Sources area on the lower left portion of the Forms Designer. You may add the elements to as many forms as you wish, but you must work with one form at a time.
 
To add the elements to a form’s Data Sources:

  1. Open the form in the Forms Designer (by clicking the form name from the Form and Workflows Homepage).
  2. In the Data Sources area on the left side of the Forms Designer, click New from XSD Image Removed icon.
  3. You’ll see all available schemas; click the plus sign Image Removedto expand the schema folders and display the global elements from each.
  4. Click the Image Removed icon next to each global element you want. If the element is a complex type, you will see the parent element only, but the child elements will be added automatically to your form’s Data Sources. You may add as many elements as you like.

Image Removed

After you close the page, you’ll see in the Data Sources area each element you chose. (We added the Address Book and Policy Information global elements in this example.) For each element you added to your form’s Data Sources,  will generate an XML instance document that you will see in the Submissions repository each time users submit your form, even if you do not end up generating a control from the element. Therefore, if you add an element to your form but later determine you don’t need to generate a control from it, make sure to delete the element from the form’s Data Sources.

Image Removed

Adding multiple data sources from the same namespace will cause a clash in your form. And in fact  will assist you by preventing you from making this mistake. A warning message is displayed in the Add Data Source panel when you click plus.

Image Removed

Similarly, multiple XSD files composing a single logical namespace is not supported. Instead, merge all XSD files for the same namespace into a single XSD file and then upload into .

Generating Controls from Schema Elements

Once the global elements are part of your form’s Data Sources you can generate controls for any or all of them. 

To generate a group control that automatically includes controls for all of a parent element’s children, click the icon to the right of the parent. The controls for the children elements will be inside a section control.  If the complex type has repeating items, the section will be inside a repeat control. 

To create individual controls for specific children of a complex type, click the + icon to expand the group and click the Image Removed icon next to each desired child element. In the above example we could generate controls for First Name and Last Name but not for the phone number or email address.

Note

You do not drag the elements from the Data Source tab into your form; instead when you click the Image Removed icon the generated controls are automatically added to your form.

The controls are added above the currently selected control. The only exception is if the control is part of a repeating group and the currently selected control is not one in that group.  must add controls in a repeating group to the same location on the form as the others from that same group. So it will ignore your selection. 

You can then place the controls where you want by following the normal drag and drop rules, with one additional restriction: you cannot drag any control into or out of a repeat control generated from a schema element. (If you need to do this, you will have to edit the schema.) Rearranging the controls will not affect the structure of the form’s XML submission documents or how submission data is captured.

Note

When a from palette form's XSD is imported as a Data Source into a new form, tab controls are lost .

Data and Display Types

Most controls generated from schema elements will appear initially as text controls. For example an xsd:integer type will appear as a text input control. However all validation for the controls will be based on the schema datatype. For example an xsd:integer type will only allow numeric values.

Schema elements that specify element restrictions will automatically be displayed as selection controls. It will display as a dropdown if there are four or more valid choices and a radio button if there are fewer than four valid values. You can change the display type between radio and dropdown and checkbox using the Display As property.

Xsd:boolean types will automatically be displayed as a boolean checkbox. If checked, the value will be 'true' and if unchecked it will be 'false' if the element is required and no value if optional. You can set the label of the true and false options via the Labels property. However only the 1st option which maps to the 'true' choice will be displayed. If you add more then 2 labels the extra labels will be auto removed. If you set only a single label a 2d label of 'false' will be auto added for you.   

Show Controls from Data Source

To locate the controls on the designer canvas that come from one of the data sources added to the form, click the Image Removed icon. This will highlight the associated controls.

Image Removed

Modifying Controls Generated from Schema Elements

There are two ways to modify controls that you generated from schema elements. You can:  

  • Make changes to the controls in the Forms Designer 
  • Make changes to the schema, and then update the schema in  by uploading the revised schema

Changes You Can Make in the Forms Designer

For controls generated from schema elements, you can make some but not all of the changes that you can for controls you drag in from the palette.  Here are the changes you can make in the Forms Designer:

  • Change the control Name — although this does not change the underlying XSD element name.
  • Create rules that rely on the controls. 
  • Set default value for the controls.
  • Rearrange the location of controls in your form. This includes moving sections into tabs or panels. As noted above, in addition to the normal drag and drop restrictions, you may not drag any control into or out of a repeat control generated from a schema element. 
  • Modify the control’s Display As property to change how the control looks on the form. The Display As property appears only for controls created from schema elements and appears instead of the Control Type property that you see for controls you have dragged in from the palette.   
  • Change the control’s label. You’ll see the new label name in the Submissions Repository Data Tab and in Excel if you download the submission results. However, the Submissions XML document for the schema will reflect the original element name.

Note that you cannot change a control’s validation behavior in the Forms Designer as you can for controls you drag in from the palette.  You must do this by changing the schema. This is discussed below.

In general, the Forms Designer prevents you from making changes that will violate the integrity of the schema and cause issues when users submit your form. One exception is if you inadvertently generate two controls from the same element—in this case, users would see two controls on the form and could submit two different values, but the Submissions XML document would not be able to capture both values since the element exists only once in the schema.

You also must be careful when deleting elements from the Data Sources area, especially if you have previously created controls from these elements.  This is discussed in detail below.

Changes You Cannot Make in the Forms Designer

One of the most important differences between controls generated from schema elements and controls you drag in from the palette is validation behavior. You’ll notice for example that you can’t check or uncheck the control’s Required checkbox in the Form Designer Properties area, nor can you access the control’s Pattern property. 

Validation for controls you generate from schema elements is based on the element’s XSD type and other schema-specific information, such as whether the control is required based on the minOccurs value. If you generate a control from an element that is an integer and another from an element that is a string, the two controls initially will be generated as text controls but the first control will require users to enter integers and the second control will not.  

You can see an element’s XSD type by clicking the control in your form and hovering over the Properties area of the Forms Designer--the XSD type and the global element to which it is bound will be displayed as a tooltip. See Display As below. The only way to change the validation for a control generated from a schema element is to revise the schema and update the schema in  with the new version. The same is true for other changes you wish to make that you cannot accomplish in the Forms Designer.

...

Schema

First, you need to generate an xml schema that will be uploaded to frevvo. See the chapter Creating a Form Connected to your Database for instructions on generating a schema using the frevvo Database Connector.

Using Your Schema

Before you can use global elements from a schema in a form, you must upload the schema XSD file into one of your frevvo projects. To upload a schema:

  1. From the Projects page, click the name of the project with the forms that will use the schema.
  2. Click Schemas from the left-hand menu.
  3. From the Schemas page, click the Image AddedAdd icon.
    Image Added
  4. On the Upload Schema Page, type a meaningful name for your schema and provide a description. (These are optional but highly recommended.) The Name and Description are each limited to 255 characters.
  5. Click Browse, locate the schema XSD file or zipfile with multiple related XSDs on disk.
  6. If there are multiple global elements in the zipfile(s) specify exact name (relative to the top level directory separated by the '/' character of the XSD file containing the root schema.
  7. Click Upload.

If your schema is valid, its name now will appear on the Schemas page. You canImage Added sort the Schemas list alpahbetically (A-Z or Z-A). If you tried to upload an invalid schema, frevvo will not allow the upload and display an error message.

Tip

Important notes about uploading schemas:

  1. You may add as many schemas as you require; however, you cannot have two or more data sources in your project with the same root element name.
  2. You may use global elements from uploaded schemas in any and all forms in the project.
  3. If you want to use the same schema elements in multiple projects, upload the schema to each project separately.   
  4. If your schema references another schema, you must upload all related schemas in a single zipfile.
  5. If you upload a zipfile all the schemas in the zipfile must be related.
  6. If you have unrelated schemas you must upload them individually or alone in their own zipfile.


Note

If you add a data source (XSD) to your form/workflow that has the root element name "form" that frevvo uses by default for the palette control XSD, you will see an application error. To resolve, edit the form or workflow "Element Name" property and change it from the default "form" to whatever you want to call it.

Adding Elements to a Form’s Data Sources

Once you’ve uploaded your schema, the next step is to choose the global elements you want for a particular form. The elements you choose will be displayed in the form’s Data Sources area on the lower left portion of the Forms Designer. You may add the elements to as many forms as you wish, but you must work with one form at a time.
 
To add the elements to a form’s Data Sources:

  1. Open the form in the Forms Designer (by clicking the form name from the Form and Workflows Homepage).
  2. In the Data Sources area on the left side of the Forms Designer, click New from XSD Image Added icon.
  3. You’ll see all available schemas; click the plus sign Image Addedto expand the schema folders and display the global elements from each.
  4. Click the Image Added icon next to each global element you want. If the element is a complex type, you will see the parent element only, but the child elements will be added automatically to your form’s Data Sources. You may add as many elements as you like.

Image Added

After you close the page, you’ll see in the Data Sources area each element you chose. (We added the Address Book and Policy Information global elements in this example.) For each element you added to your form’s Data Sources, frevvo will generate an XML instance document that you will see in the Submissions repository each time users submit your form, even if you do not end up generating a control from the element. Therefore, if you add an element to your form but later determine you don’t need to generate a control from it, make sure to delete the element from the form’s Data Sources.

Image Added

Adding multiple data sources from the same namespace will cause a clash in your form. And in fact frevvo will assist you by preventing you from making this mistake. A warning message is displayed in the Add Data Source panel when you click plus.

Image Added

Similarly, multiple XSD files composing a single logical namespace is not supported. Instead, merge all XSD files for the same namespace into a single XSD file and then upload into frevvo.

Generating Controls from Schema Elements

Once the global elements are part of your form’s Data Sources you can generate controls for any or all of them. 

To generate a group control that automatically includes controls for all of a parent element’s children, click the icon to the right of the parent. The controls for the children elements will be inside a section control.  If the complex type has repeating items, the section will be inside a repeat control. 

To create individual controls for specific children of a complex type, click the + icon to expand the group and click the Image Added icon next to each desired child element. In the above example we could generate controls for First Name and Last Name but not for the phone number or email address.

Note

You do not drag the elements from the Data Source tab into your form; instead when you click the Image Added icon the generated controls are automatically added to your form.

The controls are added above the currently selected control. The only exception is if the control is part of a repeating group and the currently selected control is not one in that group. frevvo must add controls in a repeating group to the same location on the form as the others from that same group. So it will ignore your selection. 

You can then place the controls where you want by following the normal drag and drop rules, with one additional restriction: you cannot drag any control into or out of a repeat control generated from a schema element. (If you need to do this, you will have to edit the schema.) Rearranging the controls will not affect the structure of the form’s XML submission documents or how submission data is captured.

Note

When a from palette form's XSD is imported as a Data Source into a new form, tab controls are lost .

Data and Display Types

Most controls generated from schema elements will appear initially as text controls. For example an xsd:integer type will appear as a text input control. However all validation for the controls will be based on the schema datatype. For example an xsd:integer type will only allow numeric values.

Schema elements that specify element restrictions will automatically be displayed as selection controls. It will display as a dropdown if there are four or more valid choices and a radio button if there are fewer than four valid values. You can change the display type between radio and dropdown and checkbox using the Display As property.

Xsd:boolean types will automatically be displayed as a boolean checkbox. If checked, the value will be 'true' and if unchecked it will be 'false' if the element is required and no value if optional. You can set the label of the true and false options via the Labels property. However only the 1st option which maps to the 'true' choice will be displayed. If you add more then 2 labels the extra labels will be auto removed. If you set only a single label a 2d label of 'false' will be auto added for you.   

Show Controls from Data Source

To locate the controls on the designer canvas that come from one of the data sources added to the form, click the Image Added icon. This will highlight the associated controls.

Image Added

Modifying Controls Generated from Schema Elements

The schema you retrieve from your database will be relatively generic. As a result the controls you generate from this database schema might need some tweaking to suit the specific needs of your form. You can modify a control’s behavior by making changes to the schema after you have retrieved it. There are two ways to modify controls that you generated from schema elements. You can:  

  • Make changes to the controls in the Forms Designer 
  • Make changes to the schema, and then update the schema in frevvo by uploading the revised schema

Changes You Can Make in the Forms Designer

For controls generated from schema elements, you can make some but not all of the changes that you can for controls you drag in from the palette.  Here are the changes you can make in the Forms Designer:

  • Change the control Name — although this does not change the underlying XSD element name.
  • Create rules that rely on the controls. 
  • Set default value for the controls.
  • Rearrange the location of controls in your form. This includes moving sections into tabs or panels. As noted above, in addition to the normal drag and drop restrictions, you may not drag any control into or out of a repeat control generated from a schema element. 
  • Modify the control’s Display As property to change how the control looks on the form. The Display As property appears only for controls created from schema elements and appears instead of the Control Type property that you see for controls you have dragged in from the palette.   
  • Change the control’s label. You’ll see the new label name in the Submissions Repository Data Tab and in Excel if you download the submission results. However, the Submissions XML document for the schema will reflect the original element name.

Note that you cannot change a control’s validation behavior in the Forms Designer as you can for controls you drag in from the palette.  You must do this by changing the schema. This is discussed below.

In general, the Forms Designer prevents you from making changes that will violate the integrity of the schema and cause issues when users submit your form. One exception is if you inadvertently generate two controls from the same element—in this case, users would see two controls on the form and could submit two different values, but the Submissions XML document would not be able to capture both values since the element exists only once in the schema.

You also must be careful when deleting elements from the Data Sources area, especially if you have previously created controls from these elements.  This is discussed in detail below.

Changes You Cannot Make in the Forms Designer

One of the most important differences between controls generated from schema elements and controls you drag in from the palette is validation behavior. You’ll notice for example that you can’t check or uncheck the control’s Required checkbox in the Form Designer Properties area, nor can you access the control’s Pattern property. 

Validation for controls you generate from schema elements is based on the element’s XSD type and other schema-specific information, such as whether the control is required based on the minOccurs value. If you generate a control from an element that is an integer and another from an element that is a string, the two controls initially will be generated as text controls but the first control will require users to enter integers and the second control will not.  

You can see an element’s XSD type by clicking the control in your form and hovering over the Properties area of the Forms Designer--the XSD type and the global element to which it is bound will be displayed as a tooltip. See Display As below. The only way to change the validation for a control generated from a schema element is to revise the schema and update the schema in frevvo with the new version. The same is true for other changes you wish to make that you cannot accomplish in the Forms Designer.

You also cannot change the number of repeat items on the form. This is because the number is dictated by the minOccur in the schema. If minOccur=2 then there will by default be two repeat items displayed in the form designer, for example. Thus if you click the Image Added displayed in the form designer on a repeat from schema, it will display a message indicating that this operation is not permitted. To change the number of items on the form, edit the schema and change minOccurs.  

Adding Dropdown/Radio Options

Suppose you want users to select a specific manager’s name from a dropdown list.  Your database has a 50-character limit but naturally does not include specific manager name restrictions, so the schema you retrieve initially might look something like this:

Code Block
<xsd:element minOccurs="0" name="Manager">
      <xsd:simpleType>
          <xsd:restriction base="xsd:string">
               <xsd:maxLength value="50"/>
          </xsd:restriction>
      </xsd:simpleType>
</xsd:element>

The control you generate from the initial schema will be formatted as a text control.  You can make the control a dropdown by changing the control’s Display As property but you must add the actual restrictions to the schema itself, as shown below. 

Code Block
<xsd:element minOccurs="0" name="Manager" type="ManagerType"/>
<xsd:simpleType name="ManagerType">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="John Doe"/>
       <xsd:enumeration value="Pat Johnson"/>
       <xsd:enumeration value="Mary Smith"/>
      </xsd:restriction>
 </xsd:simpleType>

You also can populate dropdown boxes dynamically from your database by writing a rule.

Adding Checkbox Options

You may also need a control to allow multi-select options. Like dropdowns and radios controls described above, the control you generate from the initial schema will be formatted as a text control.  You can make the control a checkbox by changing the control’s Display As property to Checkbox and changing the actual schema type to xsd:list as shown below:
Image Added

Code Block
<xsd:element minOccurs="0" name="colorChoice">
      <xsd:simpleType>
           <xsd:list itemType="xsd:string"/>
      </xsd:simpleType>
</xsd:element>

Once the Color Choice control is formatted as a checkbox, a labels property will display in the properties settings tab for this control. Enter your checkbox options here.
Image Added

Limitations

Tip

Currently it is not possible to list the options directly in the schema or to have a checkbox option containing a space. So a label of "dark blue" will appear in the database as "dark_blue".

Dynamic Dropdown Options

Individual controls also may trigger SQL statements, if you’ve customized your form with rules. See Dynamic Options Rule Examples for examples of using the ResultSet returned from the Database Connector to dynamically populate the options in a dropdown control.

Adding ComboBox or Message Controls from Schema

In order to add a Message or ComboBox control, you will need to edit your schema and add the appinfo attribute. Define the attribute by adding xmlns:frevvo="http://www.frevvo.com/appinfo" at the end of Line 2 in your schema. Here is an example.

Code Block
firstline2
titleOriginal Line 2
linenumberstrue
<xsd:schema xmlns="http://www.frevvo.com/database/interns_forschema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.frevvo.com/database/interns_forschema">


Code Block
firstline2
titleLine 2 with appinfo added
linenumberstrue
<xsd:schema xmlns="http://www.frevvo.com/database/interns_forschema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.frevvo.com/database/interns_forschema"> xmlns:frevvo="http://www.frevvo.com/appinfo"

Then edit the element for the control you want to convert to a ComboBox as follows. The first line will already exist in your schema. You need to add the lines represented by lines #2-7 below.

Combobox

Code Block
linenumberstrue
<xsd:element default="ComboBox" minOccurs="0" name="Department" type="xsd:string">
				         <xsd:annotation>
					         <xsd:appinfo>
						        <frevvo:displaytype>ComboBox</frevvo:displaytype>
						        <frevvo:label>Department</frevvo:label>
					        </xsd:appinfo>
				        </xsd:annotation>
			        </xsd:element>

Here is a screenshot of a schema before and after adding the annotation.

Image Added

Message Control

Follow the same instructions as above but use this annotation:

Code Block
linenumberstrue
<xsd:element default="Message" minOccurs="0" name="MessageControl" type="xsd:string">
                <xsd:annotation>
                 <xsd:appinfo>
                    <frevvo:displaytype>Message</frevvo:displaytype>
                       <frevvo:label>Message Control</frevvo:label>
                  </xsd:appinfo>
              </xsd:annotation>
              </xsd:element>

Limiting potentially repeating Data

Often the schema from your database will allow any number of elements even though you know your form will never use more than one at a time. Every schema includes the “rows” element as shown in the partial schema below—note that based on the maxOccurs value of “unbounded” in the schema, there can be an unlimited number of customer elements. 

Code Block
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=http://www.frevvo.com/database/Customer 
targetNamespace="http://www.frevvo.com/database/Customer"> 
   <xsd:element name="Customers"> 
      <xsd:complexType> 
         <xsd:sequence> 
            <xsd:element maxOccurs="unbounded" name="row"> 
               <xsd:complexType> 
                  <xsd:sequence

Since the schema says the element is unbounded, the control you generate initially will be a repeat control.  You’ll see the the Image Addedrepeat icon in the Forms Designer and if you don’t make any changes, users will see the + sign that comes with repeat controls.

Image Added

In this case, change the schema to indicate you only want to work with one customer at a time, as shown below.     

Code Block
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns=http://www.frevvo.com/database/Customer 
targetNamespace="http://www.frevvo.com/database/Customer"> 
   <xsd:element name="Customer"> 
      <xsd:complexType> 
         <xsd:sequence> 
            <xsd:element maxOccurs="1" name="row"> 
               <xsd:complexType> 
                  <xsd:sequence>

Note that now maxOccurs="1" and that will force the + sign to disappear.

Type Restrictions

Sometimes the database field will let you enter any string such as a VarChar field. However if you field is a phone number you may which to have the form restrict the input to only valid phone numbers. See the section on patterns for more common type restrictions. In this example you still want the form input to be a text box. So we do not change the Format As.

Edit your xsd:

Code Block
<xsd:element minOccurs="0" name="Home Phone">
      <xsd:simpleType>
          <xsd:restriction base="xsd:string">
               <xsd:maxLength value="12"/>
          </xsd:restriction>
      </xsd:simpleType>
</xsd:element>

Add the following simpleType restriction to your xsd.

Code Block
<xsd:simpleType name="phoneType">
    <xsd:restriction base="xsd:string">
        <xsd:pattern value="\d{2}-\d{4}-\d{4}"/>
        <xsd:pattern value="\d{4}-\d{3}-\d{3}"/>
    </xsd:restriction>
</xsd:simpleType>

Finally change the existing type for the Home Phone element to:

Code Block
<xsd:element minOccurs="0" name="Home Phone" type="phoneType"/>

Now the frevvo form will only accept valid phone numbers. If you enter an invalid phone the form will flag the field as invalid.

Display As

This property applies only to controls generated from XSD schema elements. If the control was dragged in from the palette, it has a Control Type property. Use the Display As property to change the way your control looks on your form when the control is imported from schema. For example, a text control can be changed to a dropdown or vice versa. Repeat and Table controls only have two options, Table and Repeat,  in the Display As dropdown. A Repeat control can be changed to a table control and vice versa by selecting the appropriate option. Refer to the Control Type property for the details.

This will change the control's appearance but will not affect how the control validates data. If you need to modify the control's validation behavior, you must update the schema Updating a Schema.

To see the control's underlying data type and the global element to which it is bound,  you can hover over the property tab. The expanded Data Source shown in the image below, displays the XSD path stated in the hover - the control named giftidea, is part of a complex type control named address, which is bound to the global element, addressBook. The underlying data type for the giftidea control, which was changed to display as a dropdown, will remain xs:string. 

...

The Display As property is not available for the following schema controls: Message, Date, Time, Date/Time, T/F, ComboBox. 

Required Schema Controls

The required property is disabled for controls from XSD . This is because validation is based on the XSD . Values in the xsd for the required property can be overidden with a business rule. Whether the control is required is based on the minOccurs value. If  If minOccurs="0" then the control is not required. If minOccurs="1" then the control is required. If minOccurs is greater than 1 then it will be rendered in the form as a repeat control with the minimum number of items set to the minOccurs value. A business rule can override the values in the XSD for the required property. 

If your database column allows NULL then the XSD schema generated by the frevvo database connector will set minOccurs is greater than 1 then it will be rendered in the form as a repeat control with the minimum number of items set to the minOccurs value.If you want to change whether or not the control is required='0' for this control. When this control is used in your form the field will not be required. To make this field required you have to edit the XSD to set minOccurs='1' which makes the XSD schema more restrictive then your database schema.

To change the control's required status:

  1. Write a business rule to make the field required.

    Let's say a designer created a form from a schema that contained a non-required Text field - minOccurs = 0.  The designer adds a Trigger control named tr1 and this simple rule to make the field required when the trigger control is clicked.

    Here is the relevant section of the xsd:

    Section


    Column
    width33%


    Code Block
    </xsd:element>
             <xsd:element minOccurs="0" name="NonRequiredControl" type="xsd:string">
                <xsd:annotation>
                   <xsd:appinfo>
                      <frevvo:displaytype>Text</frevvo:displaytype>
                      <frevvo:label>Non Required Control</frevvo:label>
                   </xsd:appinfo>
                </xsd:annotation>
             </xsd:element>



    Column
    width33%


    Code Block
    if(tr1.clicked){
    NonRequiredControl.required = true;
    }

    Same Rule as above built with the Visual Rule Builder


    Column
    width34%

     



  2. Edit the XSD and update it in the schema's tab for that project.

There are times when you have several fields that you want hidden and then only want to make visible depending on the value entered into another field. Thus only when the fields are visible do you want them to be required. Currently hidden required fields are still required and prevent the form from being submitted. Automatically making hidden fields not-required may be added in a future release of frevvo.

Imagine a form asks if a student speaks Spanish. If the answer is yes you want to make additional fields visible and required. But when the student doesn't speak Spanish the controls should remain hidden and not be required. Here is a solution for this use case:

...

  1. Drag/Drop a Section control from the  palette frevvo palette into the form
  2. Uncheck the visible and required properties on the section control
  3. Drag all of the from XSD controls that need to be required only when visible into the section control
  4. Add a form.load rule that sets <section>.required=false. It is not enough to set the required checkbox in the section's properties panel. It must also be done in a form.load rule
  5. Add a 2nd rule that sets <section>.required=true when you make the fields visible, with an else clause to hide the fields that clears all values from those hidden controls AND sets <section>.required=false

...

Elements with a Nillable Attribute

fully frevvo fully supports nillable element attributes in schema. In previous versions, a required field (minOccurs = 1 or greater) in a form generated from schema, HAD to have a value for the form to be submitted. The control was considered required, ie. the control would display a yellow background color. Nillable attributes override the fact that the field is required and, if present and set to true, required controls will now be considered optional.  When you submit a form and do NOT have a value in a minOccurs > 0 nillable field, the XML document  generated by  will contain frevvo will contain an EMPTY element like this <control name xsi:nil="true"/>.

...

  • Elements that contain both nillable=true and minOccurs=0, will NOT be generated in the  xml frevvo xml document.
  • Elements that are required, minOccurs > 0, and nillable = true will be treated as an optional element. This means that the UI will generate an optional control for this element instead of a required one.
  • When the value is not specified in use mode,  will  frevvo will generate the element with xsi:nil=true. Ex: <control name xsi:nil="true"/>     

...

The XML document generated by  when frevvo when the form is submitted looks like this: Notice the xsi:nil="true" for all controls where minOccurs > 0 AND nillable=true and the user did not enter a value into the form.

...

If you need to make changes beyond those allowed in the Forms Designer, make the changes in your XSD file and replace the old schema in your  project frevvo project with the new one. 

To update a schema:

...

When you open (edit) any form/workflow that used the schema, the Data Sources area will be refreshed automatically. Do not delete the updated elements from the Data Sources area unless you are absolutely sure no controls in your form were generated from the elements in the previous version of the schema.  '''Also Also, do not delete the elements and try to re-add them'''. This will cause any controls that relied on the schema to become unbounded and moved out of the schema XML document into the form's default XML document.

...

Warning

Update schema will fail if you change the 'global element name' of your schema. You will see  this error:

This scenario is not supported by frevvo. Changing the global element name changes the schema and cannot be used to replace the previous schema.

Let's say you upload a schema with two controls and build a form and a workflow with this form as a step from that schema. Then you modify your schema and delete one of the controls from the xsd. You update the original schema with the modified one. When you go to the Form/Workflow Home page, the form/workflow is flagged with an error. When schema update is done, any controls that are no longer valid to that schema are "detached" and fall into the default from scratch schema.  marks  frevvo marks them in error (pink background) to give the designer a visual cue that some investigation is necessary.


...

Adjusting Your Form after Schema Updates

Although  automatically Although frevvo automatically refreshes the elements in the Data Sources area, this does not necessarily mean your form is up to date. You must edit your form, save it, and test it again to make sure the changes to the schema have produced the results you expected. 

...

Some minor schema changes  handles frevvo handles automatically and does not require you to replace the control in the form. For example:

...

One exception is repeating elements. If you edit your schema and delete elements from within a repeating complex type,  will frevvo will automatically remove those deleted elements from your form. This is because a from schema repeating complex type is not allowed to contain any controls from the palette. Once the deleted elements automatically become unbound from the schema  automatically frevvo automatically deletes them from the form.

...

Tip

Searching submissions using a Repeat control from schema Data Sources is not supported.

Deleting Unused Data Source Elements

...

However, keep in mind that a separate XML document is created for each global element you've added to your form, so if you  you don't need a global element, delete it from the form's Data Sources. Do this by clicking the icon next to the element's name. As the illustration below shows, you cannot delete child elements of a global element; you must delete the entire parent. If you have created controls for any child element, do not delete the global (parent) element.  

...

If you upload a schema you do not need, you can delete it. Choose Schemas from the left-hand menu and click the  icon next to the name of the schema you wish to delete. (If you are working in the Forms Designer, you must finish or cancel your form to access frevvo's left-hand menu.)

If you choose to do this, be certain that none of your forms rely on elements from this schema. Any forms that use elements from the deleted elements will be adversely affected, so  will so frevvo will prevent you from deleting any schemas that are currently in use. You will see this message that list all the forms/workflows that are using the schema. 

...