Package javax.el

Examples of javax.el.ValueExpression


        if (!isValid() || !isLocalValueSet()) {
            return;
        }

        ValueExpression ve = getValueExpression("value");
        if (ve == null) {
            return;
        }

        Throwable caught = null;
        FacesMessage message = null;
        try {
            ve.setValue(facesContext.getELContext(), getLocalValue());
            setValue(null);
            setLocalValueSet(false);
        } catch (ELException e) {
            caught = e;
            String messageStr = e.getMessage();
View Full Code Here


        @SuppressWarnings("unchecked")
        Collection<Object> selection = (Collection<Object>) getStateHelper().eval(PropertyKeys.selection);
        if (selection == null) {
            selection = new HashSet<Object>();

            ValueExpression ve = getValueExpression(PropertyKeys.selection.toString());
            if (ve != null) {
                ve.setValue(getFacesContext().getELContext(), selection);
            } else {
                getStateHelper().put(PropertyKeys.selection, selection);
            }
        }
View Full Code Here

            AbstractTreeNode treeNodeComponent = findTreeNodeComponent();

            boolean newExpandedValue = toggleEvent.isExpanded();

            FacesContext context = getFacesContext();
            ValueExpression expression = treeNodeComponent
                    .getValueExpression(AbstractTreeNode.PropertyKeys.expanded.toString());
            if (expression != null) {
                ELContext elContext = context.getELContext();
                Exception caught = null;
                FacesMessage message = null;
                try {
                    expression.setValue(elContext, newExpandedValue);
                } catch (ELException e) {
                    caught = e;
                    String messageStr = e.getMessage();
                    Throwable result = e.getCause();
                    while (null != result && result.getClass().isAssignableFrom(ELException.class)) {
View Full Code Here

            MethodExpression listenerMethodExpression = this.listenerMethod.getMethodExpression(ctx, Void.TYPE,
                new Class<?>[] { ActionEvent.class });

            as.addActionListener(new MethodExpressionActionListener(listenerMethodExpression));
        } else {
            ValueExpression b = null;
            if (this.binding != null) {
                b = this.binding.getValueExpression(ctx, ActionListener.class);
            }
            ActionListener listener = new LazyActionListener(this.listenerType, b);
            as.addActionListener(listener);
View Full Code Here

    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()) {
View Full Code Here

    public PanelToggleListenerHandler(TagConfig config) {
        super(config);
    }

    public void applyAttachedObject(FacesContext context, UIComponent parent) {
        ValueExpression expression = null;
        if (this.binding != null) {
            FaceletContext ctx = (FaceletContext) context.getAttributes().get(TagHandlerUtils.FACELET_CONTEXT_KEY);
            expression = this.binding.getValueExpression(ctx, PanelToggleListener.class);
        }
View Full Code Here

     * @return value expression from string and stores expression's expected type
     */
    public static ValueExpression createValueExpression(FacesContext context, String expression, boolean literal,
            Class<?> expectedType) {

        ValueExpression result = null;

        if (!literal && ELUtils.isValueReference(expression)) {
            ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();

            if (expressionFactory == null) {
View Full Code Here

    }

    public Validator createChildrenValidator() {
        FacesBeanValidator validator = (FacesBeanValidator) getFacesContext().getApplication().createValidator(getType());
        validator.setSummary(getSummary());
        ValueExpression expression = getValueExpression("groups");
        if (null != expression) {
            validator.setGroups(expression);
        } else {
            validator.setGroups(getGroups());
        }
View Full Code Here

    public ItemChangeListenerHandler(TagConfig config) {
        super(config);
    }

    public void applyAttachedObject(FacesContext context, UIComponent parent) {
        ValueExpression valueExpr = null;
        if (this.binding != null) {
            FaceletContext ctx = (FaceletContext) context.getAttributes().get(TagHandlerUtils.FACELET_CONTEXT_KEY);
            valueExpr = this.binding.getValueExpression(ctx, ItemChangeListener.class);
        }
View Full Code Here

        this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes);
      }
    }
    if(setAttributes != null) {
      if(value == null) {
        ValueExpression ve = getValueExpression(name);
        if(ve == null) {
          setAttributes.remove(name);
        } else if(!setAttributes.contains(name)) {
          setAttributes.add(name);
        }
View Full Code Here

TOP

Related Classes of javax.el.ValueExpression

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.