myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Papadakis (JIRA)" <>
Subject [jira] [Reopened] (MYFACES-3971) ui:repeat var attribute is not a javax.el.ValueExpression
Date Wed, 01 Apr 2015 06:46:54 GMT


Alexander Papadakis reopened MYFACES-3971:

The following snippet:

<ui:repeat var="${personRepository.item}" value="#{personRepository.persons}" varStatus="stat">
<h:outputText value="#{} #{stat.index} #{personRepository.item}" /> <br />

when using the following bean 

public class PersonRepository implements Serializable {
    private Map<Integer, Person> persons = new TreeMap<Integer, Person>();

    private String item = "var";
    protected void init() {
        persons.put(1, new Person(1, "Person 1", ""));
        persons.put(2, new Person(2, "Person 2", ""));
        persons.put(3, new Person(3, "Person 3", ""));

    public List<Person> getPersons() {
        return new ArrayList<Person>(persons.values());

	public String getItem() {
		return item;

Will just print 


while it should print:

Person 1 0
Person 2 1
Person 3 2

ui:repeat will correctly iterate over the List BUT will not create the #{var} el variable
as it should (because the ui:repeat->var is not evaluated as an expression and it is used

So  the call:
                        .put(var, localModel.getRowData());

will actually be:

                        .put("${personRepository.item}", localModel.getRowData());

instead of
                        .put("var", localModel.getRowData());

This is easily reproduced. I am preparing a demo war to showcase the problem 

> ui:repeat var attribute is not a javax.el.ValueExpression
> ---------------------------------------------------------
>                 Key: MYFACES-3971
>                 URL:
>             Project: MyFaces Core
>          Issue Type: Bug
>            Reporter: Alexander Papadakis
>  As per the spec, the 'var' attribute in ui:repeat should be a javax.el.ValueExpression
(must evaluate to java.lang.Object).
> As such, it should be possible to use it in a composite with a value like #{cc.attrs.varname}
where varname is a cc:attribute populated where the composite is instantiated.
> ui:repeat as it wotks now, it will now evaluate any el sett in var.

This message was sent by Atlassian JIRA

View raw message