-1
IM开发使用JSF IM中检索的数据表,即数据,使用primefacesprimefaces数据表不能正常工作
这里的数据表标签在XHTML页面显示DATAS面临的一个问题的webapps和primefaces,是我的XHTML代码
<!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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head></h:head>
<body>
<h:form id="form">
<h:panelGrid columns="2" cellpadding="10">
<h:outputText value="Batch Name" />
<p:selectOneMenu id="city" value="#{allot.batchName}">
<f:selectItem itemLabel="Select Batch" itemValue="" />
<f:selectItems value="#{allot.batchList}" />
<p:ajax listener="#{allot.handleBatch}" />
</p:selectOneMenu>
<p:dataTable var="batch" value="#{allot.batchInfoList}" >
<p:column headerText="Tan">
<h:outputText value="#{batch.tan}" />
</p:column>
</p:dataTable>
</h:panelGrid>
</h:form>
</body>
</html>
这里被用于检索数据
package com.cation.action;
import java.util.ArrayList;
import java.util.List;
import com.cation.bean.BatchInfo;
import com.cation.controller.CationController;
public class Allocation {
private String batchName;
private List<BatchInfo> batchInfoList;
private List<String> batchList = new ArrayList<String>();
private CationController cationController = new CationController();
public String getBatchName() {
return batchName;
}
public void setBatchName(String batchName) {
this.batchName = batchName;
}
public List<BatchInfo> getBatchInfoList() {
return batchInfoList;
}
public void setBatchInfoList(List<BatchInfo> batchInfoList) {
this.batchInfoList = batchInfoList;
}
public List<String> getBatchList() {
return batchList;
}
public void setBatchList(List<String> batchList) {
this.batchList = batchList;
}
public Allocation() {
try {
batchList = cationController.getAllBatch();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public String handleBatch() {
try {
batchInfoList = new ArrayList<BatchInfo>();
batchInfoList = cationController.getBatchByName(batchName);
} catch (Exception e) {
e.printStackTrace();
}
return "allotInput";
}
}
我的条件是我的行动豆从selectone男人选择一个值时u标签我得到选定的值,并通过使用该值来检索一些对象列表并使用数据表在xhtml页面中显示。但问题是我得到的对象列表中的行动,但没有数据显示在XHTML页面。
任何人都可以帮我解决这个问题PLZ。
你怎么填'batchInfoList'? – Akheloes