I am learning Primefaces 6.1, and I want to update a ui:repeat
component. According to Alexandre's answer, I need to wrap ui:component
inside a component, such as h:panelGroup
. However, when I run the project, there is an error says:
cannot find expression for component 'blogList'
Anyone knows why? Below is part of my code.
<h:form>
<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5" >
<h:outputLabel value="Keyword: " for="keyword" />
<p:inputText id="keyword" class="searchbox" value="#{viewManagedBean.keyword}"></p:inputText>
<p:commandButton value="Search" actionListener="#{viewManagedBean.search(event)}" update="blogList"/>
</h:panelGrid>
<h:panelGroup id="blogList">
<ui:repeat value="#{viewManagedBean.guestBlogs}" var="blog">
<p:panel id="toggleable" header="#{blog.title}" footer="Created Date:#{blog.createdTime}" widgetVar="panel" style="margin-bottom:20px">
<h:outputText escape="false" value="#{blog.body}" style="font-weight: bold"/><hr />
</p:panel>
</ui:repeat>
</h:panelGroup>
</h:form>