|
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.
If an RPG program uses templates, you'll see code like the following that inserts field values into a page: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.
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.
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.
As an Amazon Associate we earn from qualifying purchases.
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.