Package javax.faces.component

Examples of javax.faces.component.UIInput$ValueChangeListenerAdapter


    public String disableValidation()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();

        UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number1");
        Validator[] validators = number1.getValidators();
        if (validators != null)
        {
            for (int i = 0; i < validators.length; i++)
            {
                Validator validator = validators[i];
                number1.removeValidator(validator);
            }
        }

        UIInput number2 = (UIInput)facesContext.getViewRoot().findComponent("form1:number2");
        validators = number2.getValidators();
        if (validators != null)
        {
            for (int i = 0; i < validators.length; i++)
            {
                Validator validator = validators[i];
                number2.removeValidator(validator);
            }
        }

        UIInput text = (UIInput)facesContext.getViewRoot().findComponent("form2:text");
        validators = text.getValidators();
        if (validators != null)
        {
            for (int i = 0; i < validators.length; i++)
            {
                Validator validator = validators[i];
                text.removeValidator(validator);
            }
        }

        return "ok";
    }
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 (ComponentUtil.getBooleanAttribute(component, ATTR_INLINE)) {
      addAspectClass(rendererName, Aspect.INLINE);
    }
    if (component instanceof UIInput) {
      UIInput input = (UIInput) component;
      if (ComponentUtil.isError(input)) {
        addAspectClass(rendererName, Aspect.ERROR);
      }
      if (input.isRequired()) {
        addAspectClass(rendererName, Aspect.REQUIRED);
      }
    }
  }
View Full Code Here

  private static final Log LOG = LogFactory.getLog(SelectBooleanCheckboxRenderer.class);

  public void decode(FacesContext facesContext, UIComponent component) {

    UIInput input = (UIInput) component;

    if (ComponentUtil.isOutputOnly(input)) {
      return;
    }

    String newValue = (String) facesContext.getExternalContext()
        .getRequestParameterMap().get(input.getClientId(facesContext));

    if (LOG.isDebugEnabled()) {
      LOG.debug("new value = '" + newValue + "'");
    }

    input.setSubmittedValue("true".equals(newValue) ? "true" : "false");
  }
View Full Code Here

        Assert.assertNull(button.getAttributes().get("metodo"));
       
        UICommand link = (UICommand) compositeComponent.findComponent("link");
        Assert.assertNotNull(link);
        Assert.assertEquals(1, link.getActionListeners().length);
        UIInput input = (UIInput) compositeComponent.findComponent("input");
        Assert.assertNotNull(input);
        Assert.assertEquals(1, input.getValidators().length);
        Assert.assertEquals(1, input.getValueChangeListeners().length);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);
       
View Full Code Here

  protected void doDecode(FacesContext context, UIComponent component) {
    String clientId = component.getClientId(context) + UIEditor.EDITOR_TEXT_AREA_ID_SUFFIX;
        Map requestParameterMap = context.getExternalContext().getRequestParameterMap();
        String newValue = (String) requestParameterMap.get(clientId);
        if (null != newValue) {
        UIInput input = (UIInput) component;
            input.setSubmittedValue(newValue);
        }
  }
View Full Code Here

  @Override
  public void queueEvent(FacesEvent event) {
    if (event instanceof ValidationEvent && event.getComponent() == this) {
      UIComponent parent = getParent();
      if (parent instanceof UIInput) {
        UIInput input = (UIInput) parent;
        if (input.isImmediate()) {
          event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
        } else {
          event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
        }
      }
View Full Code Here

                                }
                            }
                        }
                    }

                    UIInput filterValueInput = (UIInput) column
                            .getFacet(FILTER_INPUT_FACET_NAME);
                    if (null != filterValueInput) {
                        filterValueInput.decode(context);
                        String oldFilterValue = column.getFilterValue();
                        Object submittedValue = filterValueInput
                                .getSubmittedValue();
                        String newFilterValue = null;
                        if (null != submittedValue) {
                            newFilterValue = filterValueInput
                                    .getSubmittedValue().toString();
                            if ((newFilterValue != null)
                                    && (newFilterValue.length() == 0)) {
                                newFilterValue = null;
                            }
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.