empty values in extendedDataTable [RF 4.3.4]
karomann Jan 5, 2014 7:00 AMHi,
In some cases when I use rich:extendedDataTable I get empty cells in the table - the cells are literally empty, even in the rendered <h:link> with <f:param name="#{entityId}" value="#{entity.id}"/> the param value for entityId is set to 0. For all rows. However, what is quite weird, the number of displayed rows is correct. This only happens when I go to the page as a result of performing an action on another page (and another bean) - the issue does not happen when accessing the page with plain <h:link/> Am I doing something wrong?
Relevant code:
@Named
@RequestScoped
public class EntityListController {
@Inject
private EntityRepository repository;
private Iterable<Entity> list;
@PostConstruct
private void init() {
list = repository.findAll();
}
public Iterable<Entity> getParafie() {
return list;
}
}
and the page:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich">
<h:body>
<ui:composition template="/WEB-INF/templates/template.xhtml">
<ui:define name="title">EntityList</ui:define>
<ui:define name="content">
<h:link outcome="addEditEntity" value="Add entity"/>
<h1>Entities</h1>
<rich:messages globalOnly="true"/>
<rich:extendedDataTable id="entityTable" value="${entityListController}" var="entity">
<rich:column>
<f:facet name="header">Name</f:facet>
<h:link value="${entity.name}" outcome="addEditEntity">
<f:param name="entityId" value="#{entity.id}"/>
</h:link>
</rich:column>
</rich:extendedDataTable>
</ui:define>
</ui:composition>
</h:body>
</html>
The issue happens when I try to access the page returning from an action:
<h:commandButton action="#{addEditEntityController.save}" value="Save"/>
public String save() {
repository.save(parafia);
messages.addInfo().DataSavedSuccessfully();
return "index";
}
When I access the page via
<h:button outcome="index" value="Powrót"/>
the extendedDataTable is rendered correctly. The AddEditEntityController is a ViewScoped bean.