Package javax.faces.component

Examples of javax.faces.component.UIInput$ValueChangeListenerAdapter


      if (value == null)
      {
        return;
    }

    UIInput foreignComp = (UIInput) uiComponent.getParent().findComponent(_for);
    if(foreignComp==null)
      throw new FacesException("Unable to find component '" + _for + "' (calling findComponent on component '" + uiComponent.getId() + "')");

    Object[] args = {value.toString(),(foreignComp.getValue()==null) ? foreignComp.getId():foreignComp.getValue().toString()};

    if(foreignComp.getValue()==null || !foreignComp.getValue().toString().equals(value.toString())  )
      throw new ValidatorException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR,EQUAL_MESSAGE_ID, args));
   
  }
View Full Code Here



    public String getNumber1ValidationLabel()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number1");
        Validator[] validators = number1.getValidators();
        if (validators != null && validators.length > 0)
        {
            long min = ((LongRangeValidator)validators[0]).getMinimum();
            long max = ((LongRangeValidator)validators[0]).getMaximum();
            return " (" + min + "-" + max + ")";
View Full Code Here

    }

    public String getNumber2ValidationLabel()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number2");
        Validator[] validators = number1.getValidators();
        if (validators != null && validators.length > 0)
        {
            long min = ((LongRangeValidator)validators[0]).getMinimum();
            long max = ((LongRangeValidator)validators[0]).getMaximum();
            return " (" + min + "-" + max + ")";
View Full Code Here

    }

    public String getTextValidationLabel()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form2:text");
        Validator[] validators = number1.getValidators();
        if (validators != null && validators.length > 0)
        {
            long min = ((LengthValidator)validators[0]).getMinimum();
            long max = ((LengthValidator)validators[0]).getMaximum();
            return " (" + min + "-" + max + " chars)";
View Full Code Here

        if (empty)
        {
            if (uiComponent instanceof UIInput)
            {
                UIInput uiInput = (UIInput) uiComponent;
                if (uiInput.getRequiredMessage() != null)
                {
                    String requiredMessage = uiInput.getRequiredMessage();
                    throw new ValidatorException(new FacesMessage(
                            FacesMessage.SEVERITY_ERROR, requiredMessage,
                            requiredMessage));
                }
            }
View Full Code Here

        // build testValidateBean.xhtml
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "testValidateBean.xhtml");
       
        // get the component instances
        UIInput input = (UIInput) root.findComponent("form:input");
       
        // the UIInput has to have the BeanValidator installed
        Assert.assertTrue(_hasValidator(input, BeanValidator.class));
    }
View Full Code Here

        // build testValidateBeanEmptyInput.xhtml
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "testValidateBeanEmptyInput.xhtml");
       
        // get the component instances
        UIInput input = (UIInput) root.findComponent("form:input");
       
        // the UIInput has to have the BeanValidator installed
        Assert.assertTrue(_hasValidator(input, BeanValidator.class));
    }
View Full Code Here

        // build testValidateBean.xhtml
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "testValidateBean.xhtml");
       
        // get the component instances
        UIInput input = (UIInput) root.findComponent("form:input");
       
        // the UIInput must not have the BeanValidator installed
        Assert.assertFalse(_hasValidator(input, BeanValidator.class));
    }
View Full Code Here

        // build testValidateBeanNesting.xhtml
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "testValidateBeanNesting.xhtml");
       
        // get the component instances
        UIInput nestedinput = (UIInput) root.findComponent("form:nestedinput");
        UIInput doublenestedinput = (UIInput) root.findComponent("form:doublenestedinput");
        UIInput nestedinput2 = (UIInput) root.findComponent("form:nestedinput2");
        UIInput nonnestedinput = (UIInput) root.findComponent("form:nonnestedinput");
       
        // all wrapped UIInputs have to have the BeanValidator installed
        Assert.assertTrue(_hasValidator(nestedinput, BeanValidator.class));
        Assert.assertTrue(_hasValidator(doublenestedinput, BeanValidator.class));
        Assert.assertTrue(_hasValidator(nestedinput2, BeanValidator.class));
View Full Code Here

        // build testValidateBeanNesting.xhtml
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "testValidateBeanNesting.xhtml");
       
        // get the component instances
        UIInput nestedinput = (UIInput) root.findComponent("form:nestedinput");
        UIInput doublenestedinput = (UIInput) root.findComponent("form:doublenestedinput");
        UIInput nestedinput2 = (UIInput) root.findComponent("form:nestedinput2");
        UIInput nonnestedinput = (UIInput) root.findComponent("form:nonnestedinput");
       
        // all wrapped UIInputs have to have the BeanValidator installed
        Assert.assertFalse(_hasValidator(nestedinput, BeanValidator.class));
        Assert.assertFalse(_hasValidator(doublenestedinput, BeanValidator.class));
        Assert.assertFalse(_hasValidator(nestedinput2, BeanValidator.class));
View Full Code Here

TOP

Related Classes of javax.faces.component.UIInput$ValueChangeListenerAdapter

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.