我对 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;
}
}
当我想查看数据表 I 中的行时(例如,在这里我添加了 4 个条目),我只看到 4 行没有文本。
如何使条目可见?
提前致谢。