2014-01-15 33 views

回答

0

例如:

<p:dataTable id="mainDataTable" var="pm" widgetVar="dt" 
       value="#{generarPreMatriculaBean.preMatriculas}" rowKey="#{pm.id}"    
       selection="#{generarPreMatriculaBean.preMatriculasSelec}" 
       styleClass="datatable_style_general" scrollable="true" 
       rowIndexVar="rowIndex" 
       emptyMessage="No se encontró registros" 
       rowStyleClass="#{pm.generado == true ? 'old' : null}"> 

爲集選擇,你必須初始化屬性preMatriculasSelec當你在bean的init方法:

@PostConstruct 
    public void init(){ 
    preMatriculasSelec = something; 
} 

的選擇將在視圖進行檢查。