× 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.



From: Nathan Andelin

That looks pretty good, Joe. The EGL code was a little hard for me to
understand.

It was? Wow. No offense meant, Nathan, but there are only six functional
lines in the whole program: the beginning and end of the onPrerender
function (which is invoked before rendering the page), the two lines that
defines the arrays, and the two "get" instructions that fill the arrays.

This is exactly equivalent to the two P specs for an RPG ILE procedure, two
D specs to define arrays and two embedded SQL statements. I figure an ILE
expert like yourself would pick that up pretty quick. Which part confused
you? It will be good to know as a guideline for explaining EGL to other RPG
programmers.

There was also the definition of the handler itself, which was the handler
statement, which in turn defined the preRender function and the JSP that
would show the data. That could be a little tricky, but not too bad. And
of course, that's why there's a full reference manual in WDSC.


Did you leave out code defining the two arrays (details and
categoryTotals),

Nope. They were pretty clear:

details OrderDetail[0];
categoryTotals CategoryTotals[0];

Arrays in EGL are dynamic. The zero simply indicates the array starts out
with no elements.


and how do you get the two arrays to show up in the
Workbench so that you can drag and drop them onto a form?

Any variables defined in the page handler are automatically available in the
JSF editor for the associated JSP page. The JSP page is defined in the
"view=" keyword in the handler definition.


Also, would you
mind showing the code for OrderSummary.jsp, and if the .jsp file is
generated from a JSF file, would you mind sharing that too?

Well, let me politely decline in this email. That doesn't mean I won't show
it, but I want to make a couple of points clear. First, a JSF file is the
same as a JSP file. JSF is simply a set of standard tags that extend the
basic JSP syntax (much the same way that JSP extends the HTML syntax!). So
a JSF doesn't generate a JSP page, it's just a JSP file with some extra tags
in it. To enable the tags you include the JSF tag library in the web server
so that the JSP processor executes the appropriate Java code for the JSF
tags.

Second, in order to create these pages I never once had to look at the JSF
source code. In much the same way you would use SDA to create a display
file, I used nothing but the WYSIWYG JSF-aware editor to create the JSP
page. To move a widget, it's drag-and-drop, while modifying the attributes
of a widget involves simply clicking on the widget and then editing the
context-sensitive properties page.

So while I'd be happy to show you the JSF source, understand that JSF source
code is not as simple as HTML (I've written about that very issue myself in
the past), but there's a reason for it. The JSF designers designed the JSF
syntax specifically to allow it to be easily generated by tools, and
Rational has done an excellent job of integrating that bit. Personally,
I've actually gotten used to it so I can read it pretty well and can even
change it manually, but if you find EGL syntax daunting, you're likely to
have some trouble with the JSF syntax as well.

But if you're still interested in the JSP source code, I can show it to you,
just don't then expect me to then get into a debate about its complexity
vis-à-vis handcoded HTML. There's a reason why you use SDA when you create
a display file, and why you don't hand-code JSF. <smile>


If you're truly interested in taking EGL for a spin, I highly recommend you
take a look at the tutorials. Jon Sayles has a wide variety of educational
information available3 free of charge at:

http://www.jsayles.com/ibm

The EGL Language and QuickStart tutorial is a good introduction even if you
just browse the PDF. The only caveat is that it's for version 6; new
documentation for V7 is under way.

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.