org.giavacms.scenario.pojo.ProductDataModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scenario Show documentation
Show all versions of scenario Show documentation
GiavaCMS Content Management System: Scenario Module
The newest version!
package org.giavacms.scenario.pojo;
import java.util.List;
import javax.faces.model.ListDataModel;
import org.giavacms.catalogue.model.Product;
import org.primefaces.model.SelectableDataModel;
public class ProductDataModel extends ListDataModel implements
SelectableDataModel
{
public ProductDataModel()
{
}
public ProductDataModel(List pageslist)
{
super(pageslist);
}
@SuppressWarnings("unchecked")
public Product getRowData(String rowKey)
{
List products = (List) getWrappedData();
for (Product product : products)
{
if (product.getId().equals(rowKey))
return product;
}
return null;
}
public Object getRowKey(Product page)
{
return page.getId();
}
}