Package javax.faces.component

Examples of javax.faces.component.EditableValueHolder


    {
        final String value = ObjectUtils.toString(object);
        if (StringUtils.isNotBlank(value))
        {
            final String equalFieldName = field.getVarValue("fieldName");
            final EditableValueHolder equalField = (EditableValueHolder)findComponent(context, equalFieldName);
            final Object equalFieldValue = equalField.getSubmittedValue() != null ? equalField.getSubmittedValue() : equalField.getValue();

            if (equalFieldValue != null && !equalFieldValue.equals(value))
            {
                errors.add(ValidatorMessages.getMessage(
                    action,
View Full Code Here


  @Override
  public void encodeBegin(FacesContext facesContext, UIComponent component)
      throws IOException {
    super.encodeBegin(facesContext, component);
    if (component instanceof EditableValueHolder) {
      EditableValueHolder editableValueHolder = (EditableValueHolder) component;
      if (!editableValueHolder.isValid()) {
        Bridge bridge = XulUtils.getBridge();
        Zone zone = new Zone(component.getClientId(facesContext));
        bridge.addCommand(new NotValidCommand(zone));
      }
    }
View Full Code Here

        throw new IllegalArgumentException("Component : "
            + "is not a ValueHolder");
      }

      if (component instanceof EditableValueHolder) {
        EditableValueHolder editableValueHolder = (EditableValueHolder) component;
        Object submittedValue = ((EditableValueHolder) component)
            .getSubmittedValue();
        if (!editableValueHolder.isValid()) {
          editableValueHolder.setSubmittedValue(null);
        }
        if (submittedValue != null) {
          if (submittedValue instanceof String) {
            return (String) submittedValue;
          } else {
View Full Code Here

        if (component instanceof IterationStateHolder) {
            IterationStateHolder ish = (IterationStateHolder) component;

            state = new SavedState(ish);
        } else if (component instanceof EditableValueHolder) {
            EditableValueHolder evh = (EditableValueHolder) component;

            state = new SavedState(evh);
        } else if (component instanceof UIForm) {
            UIForm form = (UIForm) component;
View Full Code Here

        if (component instanceof IterationStateHolder) {
            IterationStateHolder ish = (IterationStateHolder) component;

            savedState.apply(ish);
        } else if (component instanceof EditableValueHolder) {
            EditableValueHolder evh = (EditableValueHolder) component;

            savedState.apply(evh);
        } else if (component instanceof UIForm) {
            UIForm form = (UIForm) component;
View Full Code Here

     * java.lang.Object)
     */
    public void validate(FacesContext context, UIComponent component, Object convertedValue) throws ValidatorException {
        if (component instanceof EditableValueHolder) {
            // Validate input component
            EditableValueHolder input = (EditableValueHolder) component;
            try {
                ValueExpression valueExpression = component.getValueExpression("value");
                if (null != valueExpression) {
                    BeanValidatorService validatorService = ServiceTracker.getService(BeanValidatorService.class);
                    Collection<String> messages = validatorService.validateExpression(context, valueExpression, convertedValue,
                        getGroups());
                    if (isValidateFields() && !messages.isEmpty()) {
                        input.setValid(false);
                        Object label = getLabel(context, component);
                        Locale locale = context.getViewRoot().getLocale();
                        // send all validation messages.
                        for (String msg : messages) {
                            // https://jira.jboss.org/jira/browse/RF-7636 -
View Full Code Here

        Iterator<UIComponent> facetsAndChildren = component.getFacetsAndChildren();
        while (facetsAndChildren.hasNext()) {
            UIComponent child = facetsAndChildren.next();
            if (child instanceof EditableValueHolder) {
                EditableValueHolder input = (EditableValueHolder) child;
                setupValidator(parameterObject, input);
            }

            if (!(child instanceof AbstractGraphValidator)) {
                // don't setup validators for nested GVs
View Full Code Here

        c.setId(id);

        // hack
        if (c instanceof EditableValueHolder)
        {
            EditableValueHolder evh = (EditableValueHolder) c;
            String clientId = c.getClientId(faces);
            SavedState ss = _getChildState().get(clientId);
            if (ss != null)
            {
                ss.apply(evh);
View Full Code Here

            Object value;

            if(component instanceof EditableValueHolder) {

                EditableValueHolder holder = (EditableValueHolder) component;
               
                if(holder.isLocalValueSet()) {
                    value = holder.getLocalValue();
                } else {
                    value = getValue(component);
                }
            }
            else {
View Full Code Here

    {
        // Retrieve the current FaceletContext from FacesContext object
        FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(
                FaceletContext.FACELET_CONTEXT_KEY);

        EditableValueHolder evh = (EditableValueHolder) parent;
        ValueExpression b = null;
        if (this.binding != null)
        {
            b = this.binding.getValueExpression(faceletContext, ValueChangeListener.class);
        }
        ValueChangeListener listener = new LazyValueChangeListener(this.listenerType, b);
        evh.addValueChangeListener(listener);
    }
View Full Code Here

TOP

Related Classes of javax.faces.component.EditableValueHolder

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.