Examples of ListDataModel


Examples of javax.faces.model.ListDataModel

    @SuppressWarnings("unchecked")
    protected DataModel<?> createFacesModel(Object value) {
        DataModel<?> model = null;

        if (value == null) {
            model = new ListDataModel(Collections.EMPTY_LIST);
        } else if (value instanceof DataModel) {
            model = (DataModel) value;
        } else if (value instanceof List) {
            model = new ListDataModel((List) value);
        } else if (Object[].class.isAssignableFrom(value.getClass())) {
            model = new ArrayDataModel((Object[]) value);
        } else if (value instanceof ResultSet) {
            model = new ResultSetDataModel((ResultSet) value);
        } else if (value instanceof Result) {
View Full Code Here

Examples of javax.faces.model.ListDataModel

  public DataModel getCountryDataModel()
  {
    if (mCountryDataModel == null)
    {
      mCountryDataModel = new ListDataModel(getCountries());
    }
    return mCountryDataModel;
  }
View Full Code Here

Examples of javax.faces.model.ListDataModel

  public DataModel getColumnDataModel()
  {
    if (mColumns == null)
    {
      String[] result = new String[] {"2002", "2003", "2004"};
      mColumns = new ListDataModel(new ArrayList(Arrays.asList(result)));
    }
    return mColumns;
  }
View Full Code Here

Examples of javax.faces.model.ListDataModel

        // create header info
        List headerList = new ArrayList();
        headerList.add(new ColumnHeader("Index","100",false));
        headerList.add(new ColumnHeader("Type","200",true));
        headerList.add(new ColumnHeader("Model","300",true));
        columnHeaders = new ListDataModel(headerList);

        // create list of lists (data)
        List rowList = new ArrayList();
        for (int i = 100; i <= 999; i++)
        {
            List colList = new ArrayList();
            colList.add(new Integer(i));
            colList.add("Car Type " + i);
            colList.add((i%2==0) ? "blue" : "green");
            rowList.add(colList);
        }
        data = new ListDataModel(rowList);
    }
View Full Code Here

Examples of javax.faces.model.ListDataModel

        {
            return (DataModel) value;
        }
        else if (value instanceof List)
        {
            return new ListDataModel((List) value);
        }
        else if (OBJECT_ARRAY_CLASS.isAssignableFrom(value.getClass()))
        {
            return new ArrayDataModel((Object[]) value);
        }
View Full Code Here

Examples of javax.faces.model.ListDataModel

      return new ArrayDataModel((Object[]) value);
    }

    if (value == null)
    {
      return new ListDataModel(Collections.emptyList());
    }
    else if (value instanceof List)
      return new ListDataModel((List) value);

    return new ScalarDataModel(value);
  }
View Full Code Here

Examples of javax.faces.model.ListDataModel

        {
            return (DataModel) value;
        }
        else if (value instanceof List)
        {
            return new ListDataModel((List<?>) value);
        }
        else if (OBJECT_ARRAY_CLASS.isAssignableFrom(value.getClass()))
        {
            return new ArrayDataModel((Object[]) value);
        }
View Full Code Here

Examples of javax.faces.model.ListDataModel

    ArrayList physicians = dataAccess.getPhysicians(searchCriteria);
    sortPhysicians(physicians);
   
    if (physiciansModel == null)
        {
            physiciansModel = new ListDataModel();
    }
   
    physiciansModel.setWrappedData(physicians);
   
    return this.physiciansModel;
View Full Code Here

Examples of javax.faces.model.ListDataModel

        {
            return (DataModel) value;
        }
        else if (value instanceof List)
        {
            return new ListDataModel((List) value);
        }
        // accept a Collection is not supported in the Spec
        else if (value instanceof Collection)
        {
            return new ListDataModel(new ArrayList((Collection) value));
        }
        else if (OBJECT_ARRAY_CLASS.isAssignableFrom(value.getClass()))
        {
            return new ArrayDataModel((Object[]) value);
        }
View Full Code Here

Examples of javax.faces.model.ListDataModel

        {
            return (DataModel) value;
        }
        else if (value instanceof List)
        {
            return new ListDataModel((List) value);
        }
        else if (OBJECT_ARRAY_CLASS.isAssignableFrom(value.getClass()))
        {
            return new ArrayDataModel((Object[]) value);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.