f:ajax не обновляет интерфейс:repeat

Моя страница JSF такая, <f:ajax> часть теперь работает.

<h:selectOneListbox value="#{category.categoryId}">
    <f:selectItems value="#{category.allSubCategories}" var="c" itemLabel="#{c.title}" itemValue="#{c.categoryId}" />
    <f:ajax execute="@form" render="projects" />
</h:selectOneListbox>

<h:panelGroup id="projects">
    <ul>
        <ui:repeat items="#{category.allItems}" var="o" id="itemTable">
            <li><h:graphicImage value="#{o.imageUrl}" id="itemImage" /></li>
            <li><h:outputText value="#{o.title}" /></li>
            <li><label>Price: $ </label><h:outputText value="#{o.price}" /></li>
        </ui:repeat>
    </ul>       
</h:panelGroup>

Мой боб:

@ManagedBean(name = "category")
@SessionScoped
public class CategoryServiceBean extends BaseService implements Serializable {

    private static final long serialVersionUID = -12082902292711980L;    
    private Integer categoryId;
    private Integer parentCategoryId;
    private Integer locationId;

    @ManagedProperty(value="#{categorySupport}")
    private CategorySupport categorySupport;

    public List<RestCategory> getAllSubCategories() {
        return getCategorySupport().getCategoriesByParent(locationId, parentCategoryId);            
    }

    public List<RestItem> getAllItems() {
        return response = getCategorySupport().getCategoryItems( locationId, categoryId);               
    }

    // ...
}

Моя проблема в том, что <f:ajax execute="@form" render="projects" /> не заполняет значения в <h:panelGroup id="projects">, Как это вызвано и как я могу решить это? Если я использую <h:dataTable> вместо <ui:repeat>, то работает нормально.

1 ответ

Решение
<ui:repeat items="#{category.allItems}" var="o" id="itemTable">

items атрибут не существует в <ui:repeat>, Вы явно путаете это с <c:forEach>, Использовать value приписывать.

<ui:repeat value="#{category.allItems}" var="o" id="itemTable">
Другие вопросы по тегам