Package javax.faces.application

Examples of javax.faces.application.FacesMessage


        return "./departmentHandler.xhtml";
    }

    public String createAdmin() {
        if (handler.checkUsername(getAdminName())) {
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Input Error", "Username already exists"));
            return null;
        } else {
            Account newAccount = new Account();
            newAccount.setUsername(getAdminName());
            newAccount.setPassword(getAdminPassword());

            handler.registerNewAccountDiv(newAccount, 21, getDepartment());
            FacesContext.getCurrentInstance().addMessage("superHomeTop", new FacesMessage(FacesMessage.SEVERITY_INFO, "Success.", "Administrator Account Created"));
            return "./superHome.xhtml";
        }
    }
View Full Code Here


        showCreate = 0;
    }

    public void createDepartment() {       
        if (departmentHandler.checkDepartmentName(getDepartmentName())) {
            FacesContext.getCurrentInstance().addMessage("departmentHandlerMessages", new FacesMessage(FacesMessage.SEVERITY_ERROR, "Input Error", "Department already exists"));

        } else {
            departmentRef = new Department();
            departmentRef.setDepartment(departmentName);
            departmentHandler.createDepartment(departmentRef);
            FacesContext.getCurrentInstance().addMessage("departmentHandlerMessages", new FacesMessage(FacesMessage.SEVERITY_INFO, "Success.", "Department Created"));
        }
    }
View Full Code Here

        departmentRef = selectedDepartment;
    }

    public void editDepartment() {
        if (departmentHandler.checkDepartmentName(getDepartmentEditName())) {
            FacesContext.getCurrentInstance().addMessage("departmentHandlerMessages", new FacesMessage(FacesMessage.SEVERITY_ERROR, "Input Error", "Department already exists"));

        } else {
            selectedDepartment.setDepartment(getDepartmentEditName());
            departmentHandler.editDepartment(selectedDepartment);           
            FacesContext.getCurrentInstance().addMessage("departmentHandlerMessages", new FacesMessage(FacesMessage.SEVERITY_INFO, "Success.", "Department Edited"));
        }
    }
View Full Code Here

    }

    public void deleteDepartment() {
        departmentHandler.deleteDepartment(selectedDepartment);
        selectedDepartment = null;
        FacesContext.getCurrentInstance().addMessage("departmentHandlerMessage", new FacesMessage(FacesMessage.SEVERITY_INFO, "Success.", "Department Deleted"));

    }
View Full Code Here

         motivational.setCostcenter(costCode);
         motivational.setMotivation(motivationLetter);
         motivational.setBudget(budget);
         handler.updateMoti(motivational, accountID ,appnum);
        
         FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_INFO,"Success", "Created"));
         return "applicationHome";
    }
View Full Code Here

        editForX.setDateofrequired(dateRequired);
        editForX.setDatewillbeconfirmed(dateForex);
        editForX.setReasonfortravel(reasonForTravel);

        csi.updateForex(editForX, accountID);
        FacesContext.getCurrentInstance().addMessage("submitConfirm", new FacesMessage(FacesMessage.SEVERITY_INFO, "Success", "Changes have been saved"));
        return "/applicationHome.xhtml";
    }
View Full Code Here

        forX.setDateofrequired(dateRequired);
        forX.setDatewillbeconfirmed(dateForex);
        forX.setReasonfortravel(reasonForTravel);

        csi.updateForex(forX, accountID,appnum);
        FacesContext.getCurrentInstance().addMessage("appHomeTop", new FacesMessage(FacesMessage.SEVERITY_INFO, "Success", "Changes have been saved"));
        return "/applicationHome.xhtml";
    }
View Full Code Here

        editForX.setDateofrequired(dateRequired);
        editForX.setDatewillbeconfirmed(dateForex);
        editForX.setReasonfortravel(reasonForTravel);

        csi.updateForex(editForX, accountID ,appnum);
        FacesContext.getCurrentInstance().addMessage("submitConfirm", new FacesMessage(FacesMessage.SEVERITY_INFO, "Success", "Changes have been saved"));
        return "/applicationHome.xhtml";
    }
View Full Code Here

        tempItin.setLeavetype(getTempLeaveType());
        tempItin.setTravelday(getTempTravelDay());

        appRef = appHandler.persistApplication(newApplication, newQuote, accQuotes, carQuotes, flightQuotes, tempItin, newTravel, profileRef);

        FacesContext.getCurrentInstance().addMessage("userTop", new FacesMessage(FacesMessage.SEVERITY_INFO, "Success", "Application Created"));
        return "applicationHome";
    }
View Full Code Here

                setSessionVariables();
                session.setAttribute("isFirst", false);
                //logError = false;
                return "superHome?faces-redirect=true";
            } else {
                FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Login Error", "Account has been deactivated. Please contact admin."));
                return "login";
            }
        } else {
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Login Error", "Incorrect username/password combination"));
            return "login";
        }


    }
View Full Code Here

TOP

Related Classes of javax.faces.application.FacesMessage

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.