Antonio Petrelli wrote:
2007/2/6, David H. DeWolf <[EMAIL PROTECTED]>:


Antonio Petrelli wrote:
> - Rename the <add> element to <putAttribute>, and it adds attributes
> and not values.

I'm confused.  Like Joe, I haven't found much use for the lists, but I
thought that the different between add and put was basically that the
add added a value directly to a list while the put added a new
Attribute.  I kind of equated it to a list and a map.
If you rename it to putAttribute, then it will be identical to the
refactor above.  In essence aren't you removing this tag instead of
renaming it?


Yeah, in fact now I am thinking to rename it to "putAttributeValue".
Moreover, the <add> element's name is not required, but <put> is.

Actually, there is no "name" in add. That's the entire difference between the two. It separates a simple value in a list from a named attribute - right? Because it's not a name/value pair, I think I like add better than put.




Values are still stored by <item> and <bean> (this
> erases the solution for a previous issue that I corrected, gulp!).

?

Don't worry, I was mistaken myself...

> - Remove the "required" clause to the name attribute of
> <tiles:insertAttribute>, and add a "value" attribute (with
> "rtexprvalue" set) to insert an attribute contained inside an iterated
> list attribute value.

Can you explain the use case more?  I don't see how we can insert an
attribute which hasn't been named.

A ComponentListAttribute is, in fact, a list of ComponentAttribute,
whose name is not used at all.
It is useful if you have some sort of "dynamic layout", such as a list
of attributes one under another.
For example, in the "vboxLayout.jsp" pages in the showcase there is
(now) the following snippet:

#SNIP#
<tiles:useAttribute id="list" name="list" classname="java.util.List" />

<%-- Iterate over names.
 We don't use <iterate> tag because it doesn't allow insert (in JSP1.1)
--%>
<c:forEach var="item" items="${list}">
<tiles:insertAttribute value="${item}" flush="true" />
<br>
</c:forEach>

Gotcha. Thanks for the clarification. I hadn't considered that . . .The change works for me.

#SNAP#

What it does is putting a definition or a template in those places.

Antonio

Reply via email to