Commit e37b8917 authored by michael.simon's avatar michael.simon
Browse files

Make more tables sortable and filtarable

parent d3492d1c
......@@ -11,29 +11,31 @@
package edu.kit.scc.webreg.bean.admin.role;
import java.io.Serializable;
import java.util.List;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.primefaces.model.LazyDataModel;
import edu.kit.scc.webreg.entity.RoleEntity;
import edu.kit.scc.webreg.model.GenericLazyDataModelImpl;
import edu.kit.scc.webreg.service.RoleService;
@Named("listRoleBean")
@RequestScoped
@ManagedBean
@ViewScoped
public class ListRoleBean implements Serializable {
private static final long serialVersionUID = 1L;
private List<RoleEntity> list;
private LazyDataModel<RoleEntity> list;
@Inject
private RoleService service;
public List<RoleEntity> getRoleEntityList() {
public LazyDataModel<RoleEntity> getRoleEntityList() {
if (list == null)
list = service.findAll();
list = new GenericLazyDataModelImpl<RoleEntity, RoleService, Long>(service);
return list;
}
......
......@@ -11,34 +11,31 @@
package edu.kit.scc.webreg.bean.admin.service;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.primefaces.model.LazyDataModel;
import edu.kit.scc.webreg.entity.EmailTemplateEntity;
import edu.kit.scc.webreg.model.GenericLazyDataModelImpl;
import edu.kit.scc.webreg.service.EmailTemplateService;
@Named("listEmailTemplateBean")
@RequestScoped
@ManagedBean
@ViewScoped
public class ListEmailTemplateBean implements Serializable {
private static final long serialVersionUID = 1L;
private List<EmailTemplateEntity> list;
private LazyDataModel<EmailTemplateEntity> list;
@Inject
private EmailTemplateService service;
@PostConstruct
public void init() {
list = service.findAll();
}
public List<EmailTemplateEntity> getList() {
public LazyDataModel<EmailTemplateEntity> getServiceEntityList() {
if (list == null)
list = new GenericLazyDataModelImpl<EmailTemplateEntity, EmailTemplateService, Long>(service);
return list;
}
}
......@@ -11,33 +11,31 @@
package edu.kit.scc.webreg.bean.admin.service;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.primefaces.model.LazyDataModel;
import edu.kit.scc.webreg.entity.ServiceEntity;
import edu.kit.scc.webreg.model.GenericLazyDataModelImpl;
import edu.kit.scc.webreg.service.ServiceService;
@Named("listServiceBean")
@RequestScoped
@ManagedBean
@ViewScoped
public class ListServiceBean implements Serializable {
private static final long serialVersionUID = 1L;
private List<ServiceEntity> list;
private LazyDataModel<ServiceEntity> list;
@Inject
private ServiceService service;
@PostConstruct
public void init() {
list = service.findAll();
}
public List<ServiceEntity> getServiceEntityList() {
public LazyDataModel<ServiceEntity> getServiceEntityList() {
if (list == null)
list = new GenericLazyDataModelImpl<ServiceEntity, ServiceService, Long>(service);
return list;
}
......
......@@ -33,13 +33,13 @@
</f:facet>
<h:outputText value="#{group.id}" />
</p:column>
<p:column sortBy="#{group.prefix}" filterBy="#{group.prefix}">
<p:column sortBy="#{group.prefix}" filterBy="#{group.prefix}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{messages.prefix}" />
</f:facet>
<h:outputText value="#{group.prefix}" rendered="#{group.class.simpleName == 'HomeOrgGroupEntity'}" />
</p:column>
<p:column sortBy="#{group.name}" filterBy="#{group.name}">
<p:column sortBy="#{group.name}" filterBy="#{group.name}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{messages.name}" />
</f:facet>
......
......@@ -33,13 +33,13 @@
</f:facet>
<h:outputText value="#{group.id}" />
</p:column>
<p:column sortBy="#{group.prefix}" filterBy="#{group.prefix}">
<p:column sortBy="#{group.prefix}" filterBy="#{group.prefix}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{messages.prefix}" />
</f:facet>
<h:outputText value="#{group.prefix}" />
</p:column>
<p:column sortBy="#{group.name}" filterBy="#{group.name}">
<p:column sortBy="#{group.name}" filterBy="#{group.name}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{messages.name}" />
</f:facet>
......
......@@ -33,7 +33,7 @@
</f:facet>
<h:outputText value="#{group.id}" />
</p:column>
<p:column sortBy="#{group.name}" filterBy="#{group.name}">
<p:column sortBy="#{group.name}" filterBy="#{group.name}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{messages.name}" />
</f:facet>
......
......@@ -18,14 +18,15 @@
<h:form id="form">
<p:dataTable id="dataTable" var="entity" value="#{listEmailTemplateBean.list}">
<p:dataTable id="dataTable" var="entity" value="#{listEmailTemplateBean.list}" paginator="true"
lazy="true" rows="15">
<p:column>
<f:facet name="header">
<h:outputText value="#{messages.id}" />
</f:facet>
<h:outputText value="#{entity.id}" />
</p:column>
<p:column>
<p:column sortBy="#{entity.name}" filterBy="#{entity.name}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{messages.name}" />
</f:facet>
......
......@@ -17,14 +17,15 @@
<h:form id="form">
<p:dataTable id="dataTable" var="role" value="#{listRoleBean.roleEntityList}">
<p:dataTable id="dataTable" var="role" value="#{listRoleBean.roleEntityList}" paginator="true"
lazy="true" rows="15">
<p:column>
<f:facet name="header">
<h:outputText value="#{messages.id}" />
</f:facet>
<h:outputText value="#{role.id}" />
</p:column>
<p:column>
<p:column sortBy="#{role.name}" filterBy="#{role.name}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{messages.name}" />
</f:facet>
......
......@@ -18,14 +18,15 @@
<h:form id="form">
<p:dataTable id="dataTable" var="service" value="#{listServiceBean.serviceEntityList}">
<p:dataTable id="dataTable" var="service" value="#{listServiceBean.serviceEntityList}" paginator="true"
lazy="true" rows="15">
<p:column>
<f:facet name="header">
<h:outputText value="#{messages.id}" />
</f:facet>
<h:outputText value="#{service.id}" />
</p:column>
<p:column>
<p:column sortBy="#{service.name}" filterBy="#{service.name}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{messages.name}" />
</f:facet>
......
......@@ -33,7 +33,7 @@
</f:facet>
<h:outputText value="#{user.id}" />
</p:column>
<p:column sortBy="#{user.username}" filterBy="#{user.username}">
<p:column sortBy="#{user.username}" filterBy="#{user.username}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{messages.name}" />
</f:facet>
......
......@@ -34,7 +34,7 @@
</f:facet>
<h:outputText value="#{groupFlag.group.id}" />
</p:column>
<p:column sortBy="#{groupFlag.group.name}" filterBy="#{groupFlag.group.name}">
<p:column sortBy="#{groupFlag.group.name}" filterBy="#{groupFlag.group.name}" filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="#{messages.name}" />
</f:facet>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment