Em Mon, 27 Oct 2008 15:26:24 -0300, Joel Halbert <[EMAIL PROTECTED]> escreveu:

Hi,
Does T5 support arguments to methods in expressions?

Out of the box, no. The prop binding, the default for the most component parameters, just use properties (getters and setters). On the ogher hand, using some other binding such as OGNL, provided by the t5components package. http://87.193.218.134:8080/t5components/t5c-commons/howto_ognlbinding.html, you can do what you want.

            <tr t:type="loop" t:source="promotedRows" value="var:index">
<td t:type="loop" t:source="promotedCols(${var:index})">item ${var:index}</td>
            </tr>

You can write this without OGNL, with the bonus of not putting any logic in the template. It's just a matter of changing the way you think about templates a little:

<tr t:type="loop" t:source="promotedRows" value="index">
        <td t:type="loop" t:source="promotedCols">item ${index}</td>
</tr>

In your page class:

@Property
private int index;

public List getPromotedCols() {
        return getPromotedCols(index);
}

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to