Hello Benjamin,
Decorating cell values needs more thouts to have beautiful
implementation i think. At present time solution with using column
body in iterated way is simple but powerfull. For example this code
for editing table with Struts and JSTL looks quite easy to understand
<%@ taglib uri="/WEB-INF/display.tld" prefix="disp" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<html>
<head>
<title>
Editable table test
</title>
<link rel="stylesheet" href="css/default.css" media="screen">
</head>
<body bgcolor="#ffffff">
<html:form action="/save">
<disp:table id="testRow" name="test" scope="session">
<c:set var="id" value="${testRow.id}"/>
<c:choose>
<c:when test="${action == 'Edit'}">
<disp:column title="ID">
<html:checkbox property="cb_id(${id})" value="${id}"/>
</disp:column>
</c:when>
<c:otherwise>
<disp:column property="id" title="ID"/>
</c:otherwise>
</c:choose>
<disp:column property="name"/>
<c:choose>
<c:when test="${action == 'Edit'}">
<disp:column title="Email">
<html:text property="text_email(${id})" value="${testRow.email}"/>
</disp:column>
</c:when>
<c:otherwise>
<disp:column property="email" title="Email"/>
</c:otherwise>
</c:choose>
<disp:column property="status" />
<disp:column property="description" title="Comments"/>
</disp:table>
<html:submit property="action" value="Edit"/>
<html:submit property="action" value="Save"/>
</html:form>
</body>
</html>
It naturally uses page variables and templates for showing data.
But as Benjamin it was desirable for me to create user-friendly tags,
that hide the complicated things of presentation logic behind the
parameters of decorating tags. The only way to exchange parameters
between decorator and decorating tag is pageContext, as it was
designed by developers. But may be this approach is not convenient due
to conflicts that can be met during development.
In my current projects i'm quite satisfied with iterator-style of
table tag. But it will be interesting to think about decorator
approach deeper and parameters problem is one of the main i think.
Your opinion?
P.S. To the question of more examples.
I can send my example for editing table, if it necessary, but without
struts and jst jars naturally. (They are too big for my internet
connection :)
--
Best regards,
Andrew mailto:[EMAIL PROTECTED]
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel