suite4.net.FormDatabase Documentation

IForm.SerializeToSwfXml Method (Object, WebLoaderAlert, String, String)

Serializes the current IForm, an instance of a business object and a WebLoaderAlert to an XML string. The XML is processed by the WebLoader component to dynamically draw a form and display the business object's values in a Macromedia Flash form. After the WebLoader has rendered a form, a specified JavaScript or VBScript function is called.

[Visual Basic]
Function SerializeToSwfXml( _
   ByVal dataSource As Object, _
   ByVal webLoaderAlert As WebLoaderAlert, _
   ByVal scriptFunction As String, _
   ByVal scriptFunctionArgument As String _
) As String
[C#]
string SerializeToSwfXml(
   object dataSource,
   WebLoaderAlert webLoaderAlert,
   string scriptFunction,
   string scriptFunctionArgument
);

Parameters

dataSource
The business object instance to be serialized.
webLoaderAlert
A WebLoaderAlert that is to be displayed by the WebLoader.
scriptFunction
The script function to be called after the rendering of the form has been completed.
scriptFunctionArgument
A parameter for use with the scriptFunction.

Return Value

An XML string representing the IForm and an associated business object instance.

Remarks

Example

The following example demonstrates how to serialize an IForm and with a scriptFunction.

C# sample

form = project.GetForm(formName);
if(form != null)
{
    return form.SerializeToSwfXml(null, "UpdateIFrame", "ShowAll");
}
else
{
    webLoaderAlert = new WebLoaderAlert();
    webLoaderAlert.Title = "Failed to load form";
    webLoaderAlert.Message = "Can't find form "  formName;
    return webLoaderAlert.SerializeToSwfXml();
}
            

VB.Net sample
form = project.GetForm(formName)
If Not form Is Nothing Then
    Return form.SerializeToSwfXml(Nothing, "UpdateIFrame", "ShowAll")
Else
    webLoaderAlert = New WebLoaderAlert()
    webLoaderAlert.Title = "Failed to load form"
    webLoaderAlert.Message = "Can't find form "  formName
    Return webLoaderAlert.SerializeToSwfXml()
End If
            

JavaScript sample
<script language="JavaScript">
<!--
var isInternetExplorer = navigator.appName.indexOf('Microsoft') != -1;
function WebLoader_DoFSCommand(command, args)
{
var fsObj = isInternetExplorer ? document.all.WebLoader : document.WebLoader;
var TableFrame = document.getElementById('DataIFrame');
TableFrame.src = '/support/PostingTable.aspx?Refresh='  args;
}
if (navigator.appName &;&; navigator.appName.indexOf('Microsoft') != -1 &;&; navigator.userAgent.indexOf('Windows') != -1 &;&; navigator.userAgent.indexOf('Windows 3.1') == -1)
{
document.write('<script language=\"VBScript\"\>\n');
document.write('On Error Resume Next\n');
document.write('Sub WebLoader_FSCommand(ByVal command, ByVal args)\n');
document.write('    Call WebLoader_DoFSCommand(command, args)\n');
document.write('End Sub\n');
document.write('</script\>\n');
}
//-->

</script<
            

See Also

IForm Interface | suite4.net.FormDatabase Namespace | IForm.SerializeToSwfXml Overload List