dev@jsftemplating.java.net

List / Array support in "template" format

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Thu, 10 Aug 2006 18:19:06 -0700

The XML format already had list support... but this was lacking in the
"template" format for a lack of a defined syntax. That syntax is now
defined as follows:

     name={"listElt1", "listElt2", ...}
 or
     name=["listElt1", "listElt2", ...]

 Using {}'s creates a List. Using []'s creates an array. You may use a
 comma, semi-colon, colon, space, tab, return, or a combination of these as
 a delimiter between elements. Single or double quotes are allowed,
 escaping with a '\' is supported.

Below are a couple examples, the 2nd shows how you can combine this w/
JSF EL to access individual elements of the list or array. Feel free to
copy / paste these into one of your pages to see them work.

Ken

<staticText value={'x' 'y' 'z'} />

<staticText value="#{list[1]}">
    <!beforeCreate
        setAttribute(key="list" value=["a" 'b'; 'c': "d"]);
    />
</staticText>