Examples of UIInput


Examples of javax.faces.component.UIInput


    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

Examples of javax.faces.component.UIInput

    }

    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

Examples of javax.faces.component.UIInput

    }

    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

Examples of javax.faces.component.UIInput

    }
    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

Examples of javax.faces.component.UIInput

  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

Examples of javax.faces.component.UIInput

        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

Examples of javax.faces.component.UIInput

  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

Examples of javax.faces.component.UIInput

  @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

Examples of javax.faces.component.UIInput

                                }
                            }
                        }
                    }

                    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

Examples of javax.faces.component.UIInput

            }
        }
    }

    protected void addInplaceInput(FacesContext context, UIComponent column) throws IOException {
        UIInput filterValueInput = (UIInput) column
                .getFacet(FILTER_INPUT_FACET_NAME);
        if (null == filterValueInput) {
            filterValueInput = (UIInput) context.getApplication()
                    .createComponent(UIInput.COMPONENT_TYPE);
            filterValueInput.setId(column.getId() + SORT_FILTER_PARAMETER);
            filterValueInput.setImmediate(true);
            filterValueInput.getAttributes().put(HTML.STYLE_CLASS_ATTR, "rich-filter-input");
            column.getFacets().put(FILTER_INPUT_FACET_NAME, filterValueInput);
            filterValueInput.getAttributes().put(HTML.onclick_ATTRIBUTE,
                    "Event.stop(event);");
        }
        String filterEvent = (String) column.getAttributes().get("filterEvent");
        if (null == filterEvent || "".equals(filterEvent)) {
            filterEvent = "onchange";
        }

        String buffer = buildAjaxFunction(
            context,
            column,
            false,
            buildSetFocusFunctionDef(filterValueInput.getClientId(context)));
        filterValueInput.getAttributes().put(filterEvent, buffer);
        filterValueInput.setValue(column.getAttributes().get("filterValue"));

        getUtils().encodeBeginFormIfNessesary(context, column);
        renderChild(context, filterValueInput);
        getUtils().encodeEndFormIfNessesary(context, column);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.