This article is about installation, configuration and usage of Active FoxPro Pages' Voodoo plugin with Voodoo Web Controls - Version 1.2x - a product of EPS Software, Inc.
Installation and Configuration
First we have to check that the following files:
- voodoo.plugin.exe
- voodoo.prg
- voodoo.fxp
are below the 'plugin' folder of AFP (%root%\plugin). For further information please read the content of 'Voodoo.Plugin.txt' in that folder additionally.
Okay, now open AFP 3.0 ControlCenter, open your current AFP configuration and change to tab [ Plugins ]. Insert
%root%\plugin\voodoo.plugin.exe
in the text box and click on [ Add ]. After saving the new configuration and restarting the AFP engine the plugin is at your service.
That's all about preparation and integration of Voodoo plugin. Next, we take care of the additional files shipped with your Voodoo Web Controls. Extract all compressed files from the archive 'voodoo_inetpub.zip' to a public available folder like C:\Inetpub\wwwroot. The result should be similar to this
X:\...\wwwroot\voodoo\voodooimages
Inside 'voodooimages' there are all the images and icons used by Voodoo Web Controls on your generated HTML pages. The style is like the Luna theme of Microsoft Windows XP.
Notes:
For security reason please change the extracted directory names to lower-case. IIS doesn't care about case-sensitivity but Apache without mod_spelling does. It's just to avoid possible problems.
First Voodoo Sample
Let's create a small sample file with some of the offered standard elements of Voodoo Web Controls [voodoo.afp]:
<%
Local loPage
loPage = CreateObject("AFPPage")
loPage.NewObject("frm1","WebDataForm","voodoo.prg")
loPage.frm1.Caption = "Example Form"
loPage.frm1.NewObject("txtName","WebTextbox","voodoo.prg")
loPage.frm1.txtName.AddTableRow=.T.
loPage.frm1.txtName.FirstTableRow=.T.
loPage.frm1.txtName.Label = "Customer Name:"
loPage.frm1.NewObject("txtCity","WebTextbox","voodoo.prg")
loPage.frm1.txtCity.AddTableRow=.T.
loPage.frm1.txtCity.Label = "City:"
loPage.DoEvents()
Response.Write( loPage.Render() )
%>
Wow! No HTML source code anywhere... just simple, object-oriented FoxPro programming. Something more
you would wish at this moment?
Okay, let's look at the result of this AFP document inside the browser...
For more complex forms it's recommended to define those completely as classes in your web application (.code). Then it's easier to use those form in your AFP documents. Just create an instance, optionally tweak some properties and let Voodoo render the result in HTML.
Troubleshooting
If the response of the sample page returns a simple .NULL. on the screen, then you've to do a little fix in your application file [foobar.afp(a).code]:
Procedure EVENT_PageBefore
Request.cQuerystring = Iif(IsNull(Request.cQuerystring), ;
"", ;
Request.cQuerystring)
Request.ResetQuerystring()
Endproc
Currently the problem seems to be rooted inside the Voodoo Web Controls cause with an activated Voodoo plugin the default value of Request.cQueryString changes to .NULL. instead to an empty character value as usual.
Maybe next version of either Web Controls or the plugin fixes that small issue.
Summary
The installation and configuration process of Voodoo Web Controls to work with Active FoxPro Pages is just some mouse clicks and a restart of AFP3 service. The visual HTML results are very fast rendered and absolutely easy to create.
A draw-back of Voodoo Web Controls is their strong dependency to Microsoft Internet Explorer. A standardized W3C implementation of the generated JavaScript source code is missing. But nontheless it's absoultely worth to experiment with the Base Package.
A huge feature request of coming versions of Voodoo Web Controls is about a visual designer. There was once an announcement by an user but actually I got no response about this...
That's all for now, folks...
Enjoy the AFP FAQ, JoKi