我對java primefaces有問題,無法在數據表中發現行
我有我的xhtml,如下所示;
<p:layoutUnit position="center">
<h:form>
<p:dataTable id="dataTable" var="car" value="#{myProjects.projects}" sortMode="multiple" rows="25" paginator="true">
<f:facet name="header">
Dahil Olduğum Projeler
</f:facet>
<p:column id="modelHeader" sortBy="#{projectsList.sector}">
<f:facet name="header">
<h:outputText value="Sektör" />
</f:facet>
<h:outputText value="#{projectsList.sector}" />
</p:column>
<p:column sortBy="#{projectsList.projectName}">
<f:facet name="header">
<h:outputText value="İşin Adı" />
</f:facet>
<h:outputText value="#{projectsList.projectName}" />
</p:column>
<p:column sortBy="#{projectsList.startDate}">
<f:facet name="header">
<h:outputText value="Başlangıç Tarihi" />
</f:facet>
<h:outputText value="#{projectsList.startDate}" />
</p:column>
<p:column sortBy="#{projectsList.endDate}">
<f:facet name="header">
<h:outputText value="Bitiş Tarihi" />
</f:facet>
<h:outputText value="#{projectsList.endDate}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Son Durum" />
</f:facet>
<h:outputText value="#{projectsList.lastStats}" />
</p:column>
</p:dataTable>
</h:form>
</p:layoutUnit>
而且我也有我的MyProjects的java文件:
@ManagedBean(name="MyProjects")
@SessionScoped
public class MyProjects implements Serializable {
private List<ProjectsList> projects;
public MyProjects(){
projects=new ArrayList<ProjectsList>();
projects.add(new ProjectsList("asd","asd","asd","asd","asd"));
projects.add(new ProjectsList("asd","asd","123","123","123"));
projects.add(new ProjectsList("asd","asd","123","123","123"));
projects.add(new ProjectsList("asd","asd","123","123","123"));
}
public List<ProjectsList> getProjects(){
projects.get(0);
return projects;
}
}
當我想看到的數據表我行(例如這裏我添加4項),我只看到4行沒有文字在裏面。
如何使條目可見?
在此先感謝。