"Repetitive Leaves" in RSF are a small exception to the rule that only branch tags (that is, those peering with UIBranchContainer) may be given colon IDs in the template. This is designed to streamline the quite common case where the material to be repeated consists only of a single primitive RSF component. A classic example is of a simple list of links - for example the following template segment

<a href="link1.htm" rsf:id="link:">Link 1</a>, <a href="link2.html" rsf:id="link:">Link 2</a>

can be rendered into a comma-separated list of links of any size, for example, with a loop like the following:

  for(int i = 0; i < links.length; ++ i) {
    UILink.make(tofill, "link:", linktext[i], links[i]);
    }

This "shorthand" saves on constructing a UIBranchContainer for every iteration, as well as some redudant tags in the template in this simple case. Note that leaf components can not ordinarily be given colon rsf:ids except in this simple kind of case, unless of course they are being used in the role of being seed components to an Evolver.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-) was last changed on 23-Feb-2007 21:20 by UnknownAuthor