All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.giavacms.scenario.pojo.ProductDataModel Maven / Gradle / Ivy

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();
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy