Using WebQuery

The first step in using WebQuery in your own applications is to add the WebQuery workspace as a Library in you application's workspace: in the VDF Studio menu use Tools -> Maintain Libraries -> Add Library and navigate to the file "WebQuery171.sws" in whatever directory you extracted the zip file to.

A copy of Sture Andersen's "StureApsPublicLib" is included in the WebQuery workspace (currently the 2013-10-23 version), however if you want to use a later version you can remove that one and add Sture's to your own workspace.

Next, copy the "AppHTML/Custom" directory from the WebQuery workspace into your own AppHTML directory - if you already have a "Custom" directory there, just copy the contents of the WebQuery one into it.

Open your "Index.html" file (or equivalent if you are using something else) in your AppHTML directory and make the following modifications:

After the "DataFlex Custom Controls" comment line (which you should not remove) add the following three lines of code:

<script src="Custom/wqWebApp.js"></script>
<script src="Custom/wqWebEdit.js"></script>
<link rel="stylesheet" type="text/css" href="Custom/WebQuery.css" />

A few lines farther down modify the line:

var oWebApp = new df.WebApp("WebServiceDispatcher.wso");

to read:

var oWebApp = new df.wqWebApp("WebServiceDispatcher.wso");

Open your WebApp.src file and near the top add the line:

Use cWqWebApp.pkg

after any other "Use" statements there.

Then modify the line:

Object oWebApp is a cWebApp

to read:

Object oWebApp is a cWqWebApp

Now all that remains to be done is to add WebQuery to your menu (if you wish to do that). You can do that by right-clicking on WebApp.src in the Workspace Explorer panel of the VDF Studio and selecting "Add Component(s) to WebApp.src" then navigate to the WebQuery workspace's AppSrc directory and select "WebQuery.wo". This will add WebQuery to your "View" menu, but if you have a "Reports" menu you may wish to move it there by editing WebApp.src manually. You can separate it from other items by adding the line "Set pbBeginGroup to True" in the menu item, while if you wish to give it an image you can use "Set psImage to 'Custom/report.png'".

Then compile and run your application to begin using WebQuery