JSF with PrimeFaces - Dynamic DataModel

0

I'm trying to make a screen in JSF that has a DataTable that references a DataModel dynamic, I'll show the code to exemplify:

<p:datatable value="#{bean.dataModel(id)}" var="i">
    <column (resto do código com colunas e etc..)
</p:datatable>

and no bean:

public dataModel getDataModel(Integer id) {
    dataModel = new DataModel(listaPeloId(id));
    return dataModel;
}

public void setDataModel(DataModel dataModel) {
    this.dataModel = dataModel;
}

It is something like this ... The intention is that it returns dataModel according to the ID it will receive.

(obs: I did not use rowKey in my dataTable because I have a VERY ) bug in this attribute and I was not able to make my dataTable work with this attribute, alias, if someone want to try to help me out there the question: Error in the rowKey attribute )

    
asked by anonymous 10.09.2018 / 06:12

0 answers