0
我有一個具有多選列的數據表。我希望能夠在加載時設置選定(檢查)的行。我將在post構造中從服務調用中獲得所需的所選行,但我需要知道在哪裏傳遞這些值,以便在頁面加載時檢查某些行。如何使用primefaces數據表從管理bean中設置選定的數據錶行
我有一個具有多選列的數據表。我希望能夠在加載時設置選定(檢查)的行。我將在post構造中從服務調用中獲得所需的所選行,但我需要知道在哪裏傳遞這些值,以便在頁面加載時檢查某些行。如何使用primefaces數據表從管理bean中設置選定的數據錶行
例如:
<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;
}
的選擇將在視圖進行檢查。