package com.corejsf;

import java.io.Serializable;

import javax.faces.bean.ManagedBean; 
   // lub import javax.inject.Named;
import javax.faces.bean.SessionScoped; 
   // lub import javax.enterprise.context.SessionScoped;

@ManagedBean // lub @Named
@SessionScoped
public class TableData implements Serializable {
   private static final Name[] names = new Name[] {
       new Name("Wojciech", "Domagała"),
       new Name("Anna", "Kostera"),
       new Name("Mariusz", "Rachwał"),
       new Name("Jan", "Waligóra")
   };

   public Name[] getNames() { return names;}

   public String save() {
      for (Name name : names) name.setEditable(false);
      return null;
   }
}