Package org.jboss.seam.jsf

Examples of org.jboss.seam.jsf.MapDataModel


   {
      Map<String, Person> map = new HashMap<String, Person>();
      map.put("0", new Person("Gavin"));
      map.put("1", new Person("Tom"));
     
      javax.faces.model.DataModel mapDataModel = new MapDataModel();
     
      assert mapDataModel.getRowCount() == -1;
      assert mapDataModel.getRowData() == null;
      assert !mapDataModel.isRowAvailable();
     
      mapDataModel = new MapDataModel(map);
     
      assert mapDataModel.getWrappedData() instanceof Map;
     
      assert map.get("0").equals(((Map) mapDataModel.getWrappedData()).get("0"));
      assert map.get("1").equals(((Map) mapDataModel.getWrappedData()).get("1"));
     
      mapDataModel.setRowIndex(10);
     
      assert !mapDataModel.isRowAvailable();
     
      boolean failed = false;
      try
      {
         mapDataModel.getRowData();
      }
      catch (IllegalArgumentException e)
      {
         failed = true;
      }
     
      assert failed;
     
      mapDataModel.setRowIndex(1);
     
      assert mapDataModel.isRowAvailable();
      assert mapDataModel.getRowIndex() == 1;
      assert mapDataModel.getRowCount() == 2;
     
      // JBSEAM-1660
      try
      {
         mapDataModel.setWrappedData(null);
      }
      catch (NullPointerException e)
      {
         // Spec allows passing null
         assert false;
View Full Code Here


     
      Map<String, Person> map = new HashMap<String, Person>();
      map.put("0", new Person("Gavin"));
      map.put("1", new Person("Tom"));
     
      javax.faces.model.DataModel mapDataModel = new MapDataModel(map);   
      mapDataModel.setRowIndex(1);

      Object object = null;
      try
      {
         object = serialize(mapDataModel);
View Full Code Here

      {
         return new ArrayDataModel( (Object[]) value );
      }
      else if (value instanceof Map)
      {
         return new MapDataModel( (Map) value );
      }
      else if (value instanceof Set)
      {
         return new SetDataModel( (Set) value );
      }
View Full Code Here

   {
      Map<String, Person> map = new HashMap<String, Person>();
      map.put("0", new Person("Gavin"));
      map.put("1", new Person("Tom"));
     
      javax.faces.model.DataModel mapDataModel = new MapDataModel();
     
      assert mapDataModel.getRowCount() == -1;
      assert mapDataModel.getRowData() == null;
      assert !mapDataModel.isRowAvailable();
     
      mapDataModel = new MapDataModel(map);
     
      assert mapDataModel.getWrappedData() instanceof Map;
     
      assert map.get("0").equals(((Map) mapDataModel.getWrappedData()).get("0"));
      assert map.get("1").equals(((Map) mapDataModel.getWrappedData()).get("1"));
     
      mapDataModel.setRowIndex(10);
     
      assert !mapDataModel.isRowAvailable();
     
      boolean failed = false;
      try
      {
         mapDataModel.getRowData();
      }
      catch (IllegalArgumentException e)
      {
         failed = true;
      }
     
      assert failed;
     
      mapDataModel.setRowIndex(1);
     
      assert mapDataModel.isRowAvailable();
      assert mapDataModel.getRowIndex() == 1;
      assert mapDataModel.getRowCount() == 2;
     
      // JBSEAM-1660
      /*try
      {
         mapDataModel.setWrappedData(null);
View Full Code Here

      {
         return new ArrayDataModel( (Object[]) value );
      }
      else if (value instanceof Map)
      {
         return new MapDataModel( (Map) value );
      }
      else if (value instanceof Set)
      {
         return new SetDataModel( (Set) value );
      }
View Full Code Here

TOP

Related Classes of org.jboss.seam.jsf.MapDataModel

Copyright © 2018 www.massapicom. 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.