已编辑
我想显示一个 40 列和 1000 行的可滚动表格。
我使用rich:extendedDataTable
了(我使用的是richfaces 4)clientRows="20"
,但是我得到了一个有20行的表,当我滚动时,只是这些行被更新了,我没有得到新的行!
xHTML
<rich:extendedDataTable id="idList"
value="#{declarationReglementaireModel.detailCurrentDecReg.decReg.listLigneTa3SDTO}"
var="ligneTA3" frozenColumns="2" style="height:300px; width:800px;"
selectionMode="none" clientRows="15">
<rich:column width="35px">
<h:panelGrid columns="1" cellpadding="2">
<h:commandLink action="#{rechercheDecRgltCtrl.afficherDetail}"
class="lien_detail">
<span class="icone icone-edit icone-align-center" />
<f:setPropertyActionListener
target="#{declarationReglementaireModel.detailCurrentDecReg.decReg.listLigneTa3SDTO}"
value="#{ligneTA3}" />
</h:commandLink>
</h:panelGrid>
</rich:column>
<rich:column width="150px" sortBy="#{ligneTA3.idTitre}"
sortOrder="ascending">
<f:facet name="header">Référence Titre</f:facet>
<h:outputText value="#{ligneTA3.idTitre}">
</h:outputText>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="a" />
</f:facet>
<h:outputText value="#{ligneTA3.vlColA}">
</h:outputText>
</rich:column>
...
</rich:extendedDataTable>
模型声明ReglementaireModel
@ManagedBean(name="declarationReglementaireModel")
@SessionScoped
public class DeclarationReglementaireModel implements Serializable {
private static final long serialVersionUID = 1L;
private long test ;
private LigneDecRegSortieDTO currentDecReg ;
private List<LigneDecRegSortieDTO> listDecReg ;
private DetailDecRegModel detailCurrentDecReg ;
private Integer selectedPage;
public LigneDecRegSortieDTO getCurrentDecReg() {
return currentDecReg;
}
public void setCurrentDecReg(LigneDecRegSortieDTO currentDecReg) {
this.currentDecReg = currentDecReg;
}
public List<LigneDecRegSortieDTO> getListDecReg() {
if(this.listDecReg == null){
this.listDecReg = new ArrayList<LigneDecRegSortieDTO>() ;
}
return listDecReg;
}
public void setListDecReg(List<LigneDecRegSortieDTO> listDecReg) {
this.listDecReg = listDecReg;
}
public long getTest() {
return test;
}
public DetailDecRegModel getDetailCurrentDecReg() {
return detailCurrentDecReg;
}
public void setDetailCurrentDecReg(DetailDecRegModel detailCurrentDecReg) {
this.detailCurrentDecReg = detailCurrentDecReg;
}
public void setTest(long test) {
this.test = test;
}
public void init(){
listDecReg = null ;
currentDecReg = null ;
detailCurrentDecReg = null ;
this.selectedPage = null ;
}
public Integer getSelectedPage() {
if (this.selectedPage == null)
this.selectedPage = 1;
return this.selectedPage;
}
public void setselectedPage(Integer numPage) {
this.selectedPage = numPage;
}
}
模型详情DecRegModel
public class DetailDecRegModel implements Serializable {
private static final long serialVersionUID = 1L;
private DecRegDTO decReg ;
private TypeDecRegDTO typeDecReg ;
private int nbreLignes ;
public static final int DIR_IRREG = 1 ;
public static final int GLD_CLA = 2 ;
public static final int GLD_PERIODE = 3 ;
public static final int TAB_A3 = 4 ;
public static final int TAB_A3_BIS = 5 ;
public static final int DIR_AUTRES = 6 ;
public DetailDecRegModel() {
super();
}
public DetailDecRegModel(DecRegDTO detailCurrentDecReg,
TypeDecRegDTO typeDecReg) {
super();
this.decReg = detailCurrentDecReg;
this.typeDecReg = typeDecReg;
}
public DecRegDTO getDecReg() {
return decReg;
}
public void setDecReg(DecRegDTO decReg) {
this.decReg = decReg;
}
public TypeDecRegDTO getTypeDecReg() {
return typeDecReg;
}
public void setTypeDecReg(TypeDecRegDTO typeDecReg) {
this.typeDecReg = typeDecReg;
}
public int getNbreLignes() {
switch ((int)getTypeDecReg().getIdTypeDecReg()){
case DIR_IRREG:
this.nbreLignes = decReg.getListLigneDipRecsDTO().size() ;
break;
case GLD_CLA:
this.nbreLignes = decReg.getListLigneGldsDTO().size() ;
break;
case GLD_PERIODE:
this.nbreLignes = decReg.getListLigneGldsDTO().size() ;
break;
case TAB_A3:
this.nbreLignes = decReg.getListLigneTa3SDTO().size();
break;
case TAB_A3_BIS:
this.nbreLignes = decReg.getListLigneTa3SDTO().size();
break;
case DIR_AUTRES:
this.nbreLignes = decReg.getListLigneDipRecsDTO().size() ;
break;
}
return nbreLignes;
}
public void setNbreLignes(int nbreLignes) {
this.nbreLignes = nbreLignes;
}
//public boolean isDecRegTypeDipRec(){
public boolean isDecRegTypeDirIrreg(){
return typeDecReg != null && (int)typeDecReg.getIdTypeDecReg() == DIR_IRREG ;
}
public boolean isDecRegTypeDirAutres(){
return typeDecReg != null && (int)typeDecReg.getIdTypeDecReg() == DIR_AUTRES ;
}
public boolean isDecRegTypeGldPer(){
return typeDecReg != null && (int)typeDecReg.getIdTypeDecReg() == GLD_PERIODE ;
}
public boolean isDecRegTypeGldCla(){
return typeDecReg != null && (int)typeDecReg.getIdTypeDecReg() == GLD_CLA ;
}
public boolean isDecRegTypeTabA3(){
return typeDecReg != null && (int)typeDecReg.getIdTypeDecReg() == TAB_A3 ;
}
public boolean isDecRegTypeTabA3Bis(){
return typeDecReg != null && (int)typeDecReg.getIdTypeDecReg() == TAB_A3_BIS ;
}
}