VoltoWFO
Web Form Objects Component


Introduction
User Guide
Object Model
Technical Reference
Download
Buy a License
Other Volto Components

    
Installing the Component

Download and install the setup kit containing the evaluation component. NB: If you then move the component to another location, you must re-register it with regsvr32.exe!

Sample Programs

You can now run the sample Visual Basic or Active Server Page code samples included with the evaluation component. Note that you must be connected to the internet in order for the demos to work!

Distributing the Component

When you purchase a license for this component, you will be provided with a serial number, a license key and a redistributable runtime license file. As a licensed user you may distribute the component with your compiled applications royalty-free. To ensure that your application will function correctly on a target system, your program must call the ProductLicense method to unlock licensed functionality. See the Technical Reference for more information on using this method.

Note that your application setup package must copy the component and the runtime license file to the same directory and the component must be registered. Also ensure that the Visual Basic 6.0 runtime files are installed on the target system.


Using the component with Visual Basic

When using this component to create applications with Visual Basic, you must declare a reference to the VoltoWFO component. Create a new project in Visual Basic, choose Project References (ALT, P, N) and in the list of Available References make sure that the entry entitled Volto Web Form Objects Component is selected (i.e. checked). When using a licensed component, you should first call the ProductLicense method in order to unlock full product functionality. See the Technical Reference for more information.


Introduction to the VoltoWFO Object Model:

The VoltoWFO object model includes a FormObjects collection - each member of this collection is a FormObject object representing a form to be submitted. A FormObject contains a FormItems collection - each member of this collection is a FormItem representing a single item on the form. See the Object Model or Technical Reference for more information about the object model.


How to create and submit a form:

Call the CreateForm method to create new form and to get a handle to the new form. Then call the CreateItem method for each item to be added to the form. To submit the form, call the Submit method.

In the following example, clicking the CommandButton will create and submit a single form with two form items. The form is identified as 'WFOTEST' and will be submitted using the HTTP POST method to a test page on the VOLTO.COM web site. Create a new project, add the reference to the VoltoWFO component as well as a CommandButton. Then add this code:

Private Sub Command1_Click()

  Dim objWFO As New VoltoWFO.WFO
  Dim objFormObject As VoltoWFO.FormObject

' Create the Form
  Set objFormObject = objWFO.CreateForm("WFOTEST", _
     mPost, _
    "http://www.volto.com/devtools/wfo/wfoserver.asp")

' Create the Form Items    
  objFormObject.CreateItem "Item 1", "Value 1"
  objFormObject.CreateItem "Item 2", "Value 2"

' Submit the Form 
  objFormObject.Submit

' Show the HTTP status
  MsgBox objFormObject.HTTPstatus
 
  set objWFO = nothing

End Sub
            


How a web server can update local form data:

A special feature of the VoltoWFO component is its ability to interact with web servers by parsing the server's response and dynamically updating or creating FormItem objects based on the received HTTP data.

To do this, the server must send a response containing HTTP headers that contain references to the Form items to be updated. The HTTP header names will be in the form FormID.FormItemID where FormID is the ID of a FormObject that must exist in the FormObjects collection of the calling instance of the VoltoWFO component. FormItemID is the ID of the FormItem object to be updated or created. The HTTP header values contain the values that wil be applied to the FormItem objects.

For example, the VOLTO.COM test page (WFOserver.asp) referred to in the code example above could include this code to set HTTP headers:

<%
response.addheader "WFOTEST.Item 2","New Value for Item 2!"
response.addheader "WFOTEST.Country","USA"
response.addheader "WFOTEST.Auth Code","ERZ-7GY"
%>
When the code sample above submits the form to this page, the server response will cause the value of the FormItem object with ID 'Item 2' to be updated with the value 'New Value for Item 2!. The two other headers refer to FormItem objects that do not exist (they were not created in the code sample). The VoltoWFO component will therefore create two new FormItem objects with the names and values specified in the headers.

To demonstrate this, you can modify the code example above to display a list of FormItem objects both before and after submitting the form to the test page. Add two ListBoxes to your form, and modify the code as follows:

Private Sub Command1_Click()

  Dim objWFO As New VoltoWFO.WFO
  Dim objFormObject As VoltoWFO.FormObject
  Dim objFormItem As VoltoWFO.FormItem

' Create the Form
  Set objFormObject = objWFO.CreateForm("WFOTEST", _
     mPost, _
    "http://www.volto.com/devtools/wfo/wfoserver.asp")

' Create the Form Items    
  objFormObject.CreateItem "Item 1", "Value 1"
  objFormObject.CreateItem "Item 2", "Value 2"

' Fill List1 with a list of form items BEFORE submitting
  For Each objFormItem In objFormObject.FormItems
    List1.AddItem objFormItem.ID & "=" & objFormItem.Value
  Next

' Submit the Form 
  objFormObject.Submit

' Fill List2 with a list of form items AFTER submitting
  For Each objFormItem In objFormObject.FormItems
    List2.AddItem objFormItem.ID & "=" & objFormItem.Value
  Next

' Show the HTTP status
  MsgBox objFormObject.HTTPstatus
 
  set objWFO = nothing

End Sub
            

Note: For security reasons, only FormItem objects may be created dynamically. If an HTTP header contains the ID of a non-existant FormObject, it will be ignored. A FormObject can not be created in this way.




© Copyright 2005 VOLTO.COM