public void saveName(ActionEvent actionEvent) {
                FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Pokemon " + name + " added !"));
                
                //correct strings
                HP = HP.replaceAll("[^0-9]", "");
                ATK = ATK.replaceAll("[^0-9]", "");
                DEF = DEF.replaceAll("[^0-9]", "");
                SP_ATK = SP_ATK.replaceAll("[^0-9]", "");
                SP_DEF = SP_DEF.replaceAll("[^0-9]", "");
                SPEED = SPEED.replaceAll("[^0-9]", "");
                
                Pokemon p = new Pokemon(
                        name,
                        Type.valueOf(type),
                        Double.valueOf(HP),
                        Double.valueOf(ATK),
                        Double.valueOf(DEF),
                        Double.valueOf(SP_ATK),
                        Double.valueOf(SP_DEF),
                        Double.valueOf(SPEED)
                );
                Skill pskill=null, sskill=null;
                for (Named n : Database.instance.getAllPhysicalSkills())
                    if (n.getName().equals(physicalSkill))
                        pskill = (Skill)n;
                for (Named n : Database.instance.getAllSpecialSkills())
                    if (n.getName().equals(specialSkill))
                        sskill = (Skill)n;
                if (pskill!=null)
                    p.physicalSkill=pskill;
                if (sskill!=null)
                    p.specialSkill=sskill;
                
                Database.instance.insertPokemon(p);
        }