当前位置: 首页>>代码示例>>Java>>正文


Java UIInput.getLocalValue方法代码示例

本文整理汇总了Java中javax.faces.component.UIInput.getLocalValue方法的典型用法代码示例。如果您正苦于以下问题:Java UIInput.getLocalValue方法的具体用法?Java UIInput.getLocalValue怎么用?Java UIInput.getLocalValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.faces.component.UIInput的用法示例。


在下文中一共展示了UIInput.getLocalValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate

import javax.faces.component.UIInput; //导入方法依赖的package包/类
@Override
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
    UIInput positionUI = (UIInput)component.findComponent("position");
    UIInput userTypeUI = (UIInput)component.findComponent("userType");
    String position = (String)positionUI.getLocalValue();
    UserType userType = (UserType)userTypeUI.getLocalValue();
    String inputValue = (String)value;
    if(position.equals("student") && userType == UserType.ADVANCE){
        if(inputValue == null || inputValue.trim().length()==0){
            FacesMessage message = new FacesMessage(
                    ResourceBundle.getBundle("ValidationMessages",context.getViewRoot().getLocale())
                            .getString("cn.edu.pku.lib.dataverse.validation.AdvanceBuiltinUserSupervisorValidation.message"));
            message.setSeverity(FacesMessage.SEVERITY_ERROR);
            throw new ValidatorException(message);
        }
    }
}
 
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:18,代码来源:AdvanceBuiltinUserSupervisorValidation.java

示例2: correctPasswordEntered

import javax.faces.component.UIInput; //导入方法依赖的package包/类
/**
 * Make sure the correct password was entered
 * @param components the component to check
 * @return true is correct, false otherwise
 */
private boolean correctPasswordEntered(UIComponent components) {
    UIInput uiInputVerifyPassword = (UIInput) components.findComponent("verifyPassword");
    String verifyPassword = uiInputVerifyPassword.getLocalValue() == null ? ""
            : uiInputVerifyPassword.getLocalValue().toString();
    if (verifyPassword.isEmpty()) {
        statusMessage = "";
        return false;
    } else {
        if (verifyPassword.equals(password)) {
            return true;
        } else {
            statusMessage = "Invalid password entered!";
            return false;
        }
    }
}
 
开发者ID:McBrosa,项目名称:MapChat,代码行数:22,代码来源:AccountManager.java

示例3: validate

import javax.faces.component.UIInput; //导入方法依赖的package包/类
@Override
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
    UIInput userTypeUI = (UIInput)component.findComponent("userType");
    UserType userType = (UserType)userTypeUI.getLocalValue();
    String inputValue = (String)value;
    if(userType == null || userType == UserType.ADVANCE){ //userType == null为编辑模式下,用户类型为高级
        if(inputValue == null || inputValue.trim().length()==0){
            FacesMessage message = new FacesMessage(
                    ResourceBundle.getBundle("ValidationMessages",context.getViewRoot().getLocale())
                            .getString("org.hibernate.validator.constraints.NotBlank.message"));
            message.setSeverity(FacesMessage.SEVERITY_ERROR);
            throw new ValidatorException(message);
        }
    }
}
 
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:16,代码来源:AdvanceBuiltinUserNotBlankValidator.java

示例4: validate

import javax.faces.component.UIInput; //导入方法依赖的package包/类
@Override
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
    UIInput userTypeUI = (UIInput)component.findComponent("userTypeIAAA");
    UserType userType = (UserType)userTypeUI.getLocalValue();
    String inputValue = (String)value;
    if(userType == null || userType == UserType.ADVANCE){ //userType == null为编辑模式下,用户类型为高级
        if(inputValue == null || inputValue.trim().length()==0){
            FacesMessage message = new FacesMessage(
                    ResourceBundle.getBundle("ValidationMessages",context.getViewRoot().getLocale())
                            .getString("org.hibernate.validator.constraints.NotBlank.message"));
            message.setSeverity(FacesMessage.SEVERITY_ERROR);
            throw new ValidatorException(message);
        }
    }
}
 
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:16,代码来源:AdvancePkuIAAAUserNotBlankValidator.java

示例5: validateInformation

import javax.faces.component.UIInput; //导入方法依赖的package包/类
/**
 * Validate the password
 * @param event 
 */
public void validateInformation(ComponentSystemEvent event) {
    FacesContext fc = FacesContext.getCurrentInstance();

    UIComponent components = event.getComponent();
    // get password
    UIInput uiInputPassword = (UIInput) components.findComponent("password");
    String pwd = uiInputPassword.getLocalValue() == null ? ""
            : uiInputPassword.getLocalValue().toString();

    // get confirm password
    UIInput uiInputConfirmPassword = (UIInput) components.findComponent("confirmPassword");
    String confirmPassword = uiInputConfirmPassword.getLocalValue() == null ? ""
            : uiInputConfirmPassword.getLocalValue().toString();

    if (pwd.isEmpty() || confirmPassword.isEmpty()) {
        // Do not take any action. 
        // The required="true" in the XHTML file will catch this and produce an error message.
        return;
    }

    if (!pwd.equals(confirmPassword)) {
        message = "Passwords must match!";
    } else {
        message = "";
    }   
}
 
开发者ID:McBrosa,项目名称:MapChat,代码行数:31,代码来源:PasswordResetManager.java

示例6: validateInformation

import javax.faces.component.UIInput; //导入方法依赖的package包/类
/**
 * Make sure the two password are equal when the event is received
 * @param event the event to listen for
 */
public void validateInformation(ComponentSystemEvent event) {
    FacesContext fc = FacesContext.getCurrentInstance();

    UIComponent components = event.getComponent();
    // Get password
    UIInput uiInputPassword = (UIInput) components.findComponent("password");
    String pwd = uiInputPassword.getLocalValue() == null ? ""
            : uiInputPassword.getLocalValue().toString();

    // Get confirm password
    UIInput uiInputConfirmPassword = (UIInput) components.findComponent("confirmPassword");
    String confirmPassword = uiInputConfirmPassword.getLocalValue() == null ? ""
            : uiInputConfirmPassword.getLocalValue().toString();

    if (pwd.isEmpty() || confirmPassword.isEmpty()) {
        // Do not take any action. 
        // The required="true" in the XHTML file will catch this and produce an error message.
        return;
    }

    if (!pwd.equals(confirmPassword)) {
        statusMessage = "Passwords must match!";
    } else {
        statusMessage = "";
    }   
}
 
开发者ID:McBrosa,项目名称:MapChat,代码行数:31,代码来源:AccountManager.java

示例7: validatePassword

import javax.faces.component.UIInput; //导入方法依赖的package包/类
public void validatePassword(ComponentSystemEvent event) {
    FacesContext fc = FacesContext.getCurrentInstance();

    UIComponent components = event.getComponent();

    // get password
    UIInput uiInputPassword = (UIInput) components.findComponent("newPassword");
    String password = uiInputPassword.getLocalValue() == null ? ""
            : uiInputPassword.getLocalValue().toString();
    String passwordId = uiInputPassword.getClientId();

    // get confirm password
    UIInput uiInputConfirmPassword = (UIInput) components.findComponent("newConfirmPassword");
    String confirmPassword = uiInputConfirmPassword.getLocalValue() == null ? ""
            : uiInputConfirmPassword.getLocalValue().toString();

    // Let required="true" do its job.
    if (password.isEmpty() || confirmPassword.isEmpty()) {
        return;
    }

    if (!password.equals(confirmPassword)) {
        FacesMessage msg = new FacesMessage(bundle.getString("resetpassword.error.notmatch"));
        msg.setSeverity(FacesMessage.SEVERITY_ERROR);
        fc.addMessage(passwordId, msg);
        fc.renderResponse();
    }
}
 
开发者ID:SECQME,项目名称:watchoverme-server,代码行数:29,代码来源:ResetPasswordBean.java


注:本文中的javax.faces.component.UIInput.getLocalValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。