× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Nathan Andelin wrote:
Joe, you seem to have a misconception about HTML templates used by CGIDEV2 and similar toolkits. They're much different than the "tagging approach" used by Java frameworks. But you can do the research yourself; I just mention it as an aside.
I'm quite comfortable with HTML templates, Nathan. They're fragments of HTML with substitution areas marked. I'd be interested to see what you see as the difference between a CGI substitution tag, a tag in a framework like Tapestry, and a <%= %> substitution in JSP.

I really wanted to ask about the "no work on your part". What about defining EGL records? And what is it that automatically binds them to fields on the page?
The record is the central concept in EGL (as it should be in any business language). EGL supports metadata: it allows you to define not only the data and its type, but also things like the field prompt and the validation logic. The code to support all of this is automatically generated when you drop a field on a page, whether it's a standalone field, a record, or an array of records.

The binding is done automatically; there is no need to call ZbhGetVar (or its equivalent) to retrieve the data.

If an RPG program uses templates, you'll see code like the following that inserts field values into a page:

rptVarSet('type':%trimr(codetype));
rptVarSet('desc':%trimr(typedesc));

Notice that the API also allows the %trimr() function to be called, but it could just as well be any other type of data formatting, or even decrypting the field before outputting it. Or if the user is not authorized to see the field, an empty value could be returned. Or the statement could be conditional. This is quite powerful on the one hand, and perfunctory on the other. It's the type of code you could do when your half asleep.
But it's also the kind of code that gets you in trouble. There's no checking, and it's quite easy to put the contents of the wrong field into the HTML page. In your case, you have to know that the HTML tag "desc" is supposed to contain data from the field "typedesc", not "itemdesc". It's an extra manual binding step that's very easy to do incorrectly. With EGL, you simply drop the record on the page, and EGL makes sure the HTML contains the data from the record.

EGL also knows about JSF, much moreso than CGIDEV. Here's a VERY simple example. I created a radio button group using JSF (I did this yesterday in a demo for a user group). The button group had four buttons: Dogs, Cats, Birds and Iguanas. I bound that select field to a string field in my EGL program with a simple point and click. Now, if I set the field to "Dogs", the appropriate radio button in the group is selected.

How would you do that in CGIDEV?


And if it's just too perfunctory, you could write a procedure to automatically map fields from an externally defined data structure to fields on the page with a single function call, which is what the folks at cnxcorp did in their Valence RPG toolkit.
But you don't need a toolkit. EGL does it for you. And it does a lot more.

Joe

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.