Joe Pluta wrote:
But you don't need a toolkit. EGL does it for you.
You don't need a toolkit? EGL is a toolkit. I don't follow the logic.
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?
I'll show you the code generated by Dreamweaver when you insert a radio
group on a form:
<form name="form" method="post" action="">
<label><input type="radio" name="rg" value="0">Dogs</label>
<label><input type="radio" name="rg" value="1">Cats</label>
<label><input type="radio" name="rg" value="2">Birds</label>
<label><input type="radio" name="rg" value="3">Iquanas</label>
</form>
I'd add the following statement in a <script> tag:
document.forms[0].rg[{{creature}}].checked = true;
In the RPG program I'd write:
wtnFldSet('creature':%char(creature));
"creature" is the name of the database field containing a value of 0-3.
I'd be interested to see what you see as the difference between
a CGI substitution tag, a tag in a framework like Tapestry.
Just consider the example above. If you understand that wtnFldSet()
inserts a program variable in the page location delimited by
{{creature}}, then there's essentially nothing more to explain.
In contrast, consider Tapestry's component library and the volumes of
documentation surrounding it:
http://tapestry.apache.org/tapestry5/tapestry-core/ref/index.html
What occurs when you insert a Tapestry "grid" tag?
<t:grid source="users" row="user">
<t:parameter name="lastnamecell">
<t:pagelink page="user/view"
context="user.id">${user.lastname}</t:pagelink>
</t:parameter>
</t:grid>
There's really a disconnect in the developer's mind between what you see
in the JSP and what's downloaded to the browser. And HTML authors won't
understand it.
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.
That's arguable, but if I felt the same then I'd write a generic
procedure that automatically mapped values from an externally described
data structure to page elements, and visa versa, similar to the one in
the Valence toolkit. Just pass the name and %addr() of the data
structure as parameters, and do the mapping with a single line of code.
Following is a derivative of a radio group. How would you do it in EGL?
Would drag & drop, point & click, fill in the blank methods apply?
Enjoy!
http://www.radile.com/rdweb/temp/rg.html
Nathan.
As an Amazon Associate we earn from qualifying purchases.