Tuesday, November 23, 2010

Where to Store HTML Forms?

With the -HTMLFORM syntax, WebFOCUS provides web app developers with a way to utilize HTML forms and syntax within the FOCUS 4GL code.  You can include not only web pages for displays and user input but JavaScript processing as well.

You have two options when doing this: either embed the HTML code inside the WebFOCUS code or reference an existing HTML page stored elsewhere.  

Syntax for inline HTML code:



Syntax for referencing separate HTML code:



You can see your Information Builders documentation for more details on the -HTMLFORM command. I have seen both of the above options in use at client sites and only recently encountered an issue that would cause me to suggest one approach over the other.

If you embed the HTML form inside the 4GL code using the BEGIN and END tags, the WebFOCUS pre-processor for Dialogue Manager symbolic variables will read that HTML code. If you have ampersand variables referenced in the HTML form, you run the risk of having substitution happen when you do not want it. Then, you need to take extra steps to make sure your variables are not evaluated and changed to their literal values. For example, if your HTML contains a servlet call with variables, those will get evaluated and changed (not what you want to happen).

If on the other hand your program just references the HTML form stored in an HTML file, WebFOCUS does not do the symbolic variable evaluations. Problem avoided. 

So here is my advice. If you need to dynamically build an HTML form, then putting it inline and using Dialogue Manager is your best approach. However for static HTML forms, you should always put the HTML code elsewhere and reference it by name inside your WebFOCUS code.

Another note: I believe that as of the latest 7.6 release, your HTML form file must be on the WebFOCUS Report Server in the app path and not in the Managed Reporting Environment. When searching for the referenced HTML form file, WebFOCUS is currently only searching the WFRS applications and not looking in MRE (I have asked IBI for an enhancement to the command).

0 comments:

About Me

My Photo
Doug Lautzenheiser is a leading subject matter expert in the use of Business Intelligence software within corporate organizations. He is one the top authorities in the WebFOCUS BI software product, from Manhattan-based Information Builders. While a vendor employee, Doug was trained and certified in IB's BI products all the way through the internal workings of the software.

During his 13-year career with IB, Doug led regional education, consulting, and pre-sales technical support services. In addition to being a software vendor employee, Doug spent 7 years with IB customers and 5 years with IB partners.

Doug has provided BI services to organizations such as Procter & Gamble, The Wendy's Company, TDS Telecom, TriHealth, Hormel Foods, JPMorgan Chase, MasterCard, the State of Indiana, the State of Oklahoma, and the Choctaw Nation of Oklahoma.

Doug is general manager of Partner Intelligence, a Cincinnati-based consulting firm specializing in BI professional services: strategic advice, BI application development, and automated modernization tools and methodologies.