Using:
- PF4
- JSF 2.2
- JEE7
- Glassfish 4
I've got a DataTable of which I'm using a lazy dataset. This much works fine.
Now if I want to add a button in one of the columns, using either CommandLink or CommandButton - various client events fire, however neither action or actionListener gets fired.
If I remove the lazy dataset everything works fine... Hence I'm really confused...
For the time being... I've not implemented sort/filtering on my Lazy collection as I need the basics working first:
Code: Select all
@PostConstruct
public void init() {
// lazy
lazyProjects = new LazyDataModel<Project>() {
@Override
public List<Project> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, String> filters) {
List<Project> projects = projectFacade.findRange(first, pageSize);
setRowCount(projectFacade.count());
return projects;
}
};
// non-lazy
projects = projectFacade.findAll();
}
Code: Select all
<p:dataTable id="taskTable" value="#{taskListBean.lazyProjects}" lazy="true"
var="item"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
currentPageReportTemplate="{startRecord} - {endRecord} of {totalRecords}"
rowsPerPageTemplate="10,100,500,1000,5000" rows="10"
>
/* display columns omitted */
<p:column headerText="Action" >
<p:commandLink actionListener="#{taskListBean.doEdit(item)}" title="Edit">
<span class="ui-icon ui-icon-pencil">Edit</span>
</p:commandLink>
<p:commandLink rendered="#{request.isUserInRole('admin')}" action="#{taskListBean.destroy}" title="Delete" >
<span class="ui-icon ui-icon-trash">Delete</span>
</p:commandLink>
</p:column>
</p:dataTable>
If the only thing I do is switch the dataTable to use the non-lazy collection:
Code: Select all
<p:dataTable id="taskTable" value="#{taskListBean.projects}" ...
Anyone have any hints as to what might be going wrong?
Thanks,
- JK