Omnis Technical Note TNWE0027 Oct 2013
Creating Dynamic Web Forms
for Omnis Studio 5.2.x/6.x or above (tested on IE, Firefox and Chrome with an IIS server)
This tech note and sample library were provided by Omnis developer Kris Geerts (www.it8-projects.com) in the Netherlands.
First make sure you have a working web server environment. To do this you could test the HTML page generated automatically by Omnis containing your Remote Form from within your development environment (127.0.0.1/jshtml/<remoteformname>.htm ), which uses the built-in Omnis web server. So you don't need a personal web server for this to work. However, if you want to port the solution to a real web server, it is very important to have all the referenced files and the HTML pages in the correct directory of your web server. Also first make sure your web server is working properly. On IIS (Windows) you should have the following directories and files:
Inetpub (normally on c:\inetpub)
I actually have two scripts directories. So copy the content of your 'HTML' folder from the Omnis development installation tree to the root of the web server's html root. Also check that you are using the latest version of the omnisapi.dll (or nphomniscgi. exe) and other scripts (in the folder \Clientserver\ server\cgi). Now your static created html pages should work from the root. If not, first create a simple static html page and place it into the wwwroot and try to open it with a browser. If you are testing from other machines, be careful to open the right ports on the firewall, etc. Ok, we have a working server, so what next?
To test the demo library, open the LOGIN.lbs library on the Omnis Server. Paste the following URL into a browser, replacing all three <> values with the correct IP address and port number:
Note: I use only one parameter along with my first call for this demo, but you could of course add additional parameters (param2=whateveryoulike, etc.). The example handles four parameters, but you could have more. If you would like to use a basic html form to access the login screen, please have a look at the 'statical-Submitexample' in the rtDir Remotetask in the example library. In order to provide a more comfortable login for the user, I use the above approach.
As you see in the example library, I use hard coded paths to my css folder and others, because I have noticed that an HTML page returned by the Remote Task is relative to the 'cgi-bin' and not to wwwroot. This means that instead of 'http://server/<filename>.htm' the following URL path is being used: 'http://server/cgi-bin/<filename>.htm'
Have fun! – Kris Geerts
Download the sample library from Github: https://github.com/OmnisStudio/Omnis-DynamicForms (requires Studio 8.1.2 or above)
Or download the archive: LOGIN.zip (for Studio 5.2.x, conversion required for Studio 6.x or above)