Package javax.faces.event

Examples of javax.faces.event.ValueChangeListener


    public void testEventsQueueing() throws Exception {
        HtmlInputText input = new HtmlInputText();

        final TestCallback testCallback = new TestCallback();
        input.addValueChangeListener(new ValueChangeListener() {
            public void processValueChange(ValueChangeEvent event) throws AbortProcessingException {
                testCallback.getAndIncrement();
                assertEquals(data.get(1), getVarValue());
            }
        });
View Full Code Here


                                    new MethodExpressionValidator(methodExpression));
                        }
                        else if ("valueChangeListener".equals(attributeName))
                        {
                            // target is EditableValueHolder
                            ValueChangeListener valueChangeListener = null;
                            if (methodExpression == null)
                            {
                                methodExpression = context.getApplication().getExpressionFactory().
                                        createMethodExpression(context.getELContext(),
                                                attributeExpressionString, Void.TYPE,
View Full Code Here

        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

            this.binding = binding;
        }

        public void processValueChange(ValueChangeEvent event) throws AbortProcessingException
        {
            ValueChangeListener instance = null;
            FacesContext faces = FacesContext.getCurrentInstance();
            if (faces == null)
            {
                return;
            }
            if (this.binding != null)
            {
                instance = (ValueChangeListener) binding.getValue(faces.getELContext());
            }
            if (instance == null && this.type != null)
            {
                try
                {
                    instance = (ValueChangeListener) ReflectionUtil.forName(this.type).newInstance();
                }
                catch (Exception e)
                {
                    throw new AbortProcessingException("Couldn't Lazily instantiate ValueChangeListener", e);
                }
                if (this.binding != null)
                {
                    binding.setValue(faces.getELContext(), instance);
                }
            }
            if (instance != null)
            {
                instance.processValueChange(event);
            }
        }
View Full Code Here

            String targetAttributeName,
            String attributeExpressionString,
            ValueExpression attributeNameValueExpression,
            boolean ccAttrMeRedirection)
    {
        ValueChangeListener o = (ValueChangeListener) mctx.removeMethodExpressionTargeted(
                innerComponent, targetAttributeName);
        if (o != null)
        {
            ((EditableValueHolder) innerComponent).removeValueChangeListener(o);
        }

        // target is EditableValueHolder
        ValueChangeListener valueChangeListener = null;
        // If it is a redirection, a wrapper is used to locate the right instance and call it properly.
        if (ccAttrMeRedirection)
        {
            valueChangeListener = new RedirectMethodExpressionValueExpressionValueChangeListener(
                    attributeNameValueExpression);
View Full Code Here

                }
                else
                {
                    className = _type;
                }
                ValueChangeListener vcl = (ValueChangeListener)ClassUtils.newInstance(className);
                ((EditableValueHolder)component).addValueChangeListener(vcl);
            }
            else
            {
                throw new JspException("Component " + component.getId() + " is no EditableValueHolder");
View Full Code Here

                                        innerComponent.markInitialState();
                                    }
                                }
                                else if ("valueChangeListener".equals(attributeName))
                                {
                                    ValueChangeListener o = (ValueChangeListener) mctx.removeMethodExpressionTargeted(innerComponent, attributeName);
                                    if (o != null)
                                    {
                                        ((EditableValueHolder)innerComponent).removeValueChangeListener(o);
                                    }

                                    // target is EditableValueHolder
                                    ValueChangeListener valueChangeListener = null;
                                    // If it is a redirection, a wrapper is used to locate the right instance and call it properly.
                                    if (ccAttrMeRedirection)
                                    {
                                        valueChangeListener = new RedirectMethodExpressionValueExpressionValueChangeListener(attributeNameValueExpression);
                                    }
View Full Code Here

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

            this.binding = binding;
        }

        public void processValueChange(ValueChangeEvent event)
              throws AbortProcessingException {
            ValueChangeListener instance = null;
            FacesContext faces = FacesContext.getCurrentInstance();
            if (faces == null) {
                return;
            }
            if (this.binding != null) {
                instance = (ValueChangeListener) binding
                      .getValue(faces.getELContext());
            }
            if (instance == null && this.type != null) {
                try {
                    instance = (ValueChangeListener) ReflectionUtil
                          .forName(this.type).newInstance();
                } catch (Exception e) {
                    throw new AbortProcessingException(
                          "Couldn't Lazily instantiate ValueChangeListener",
                          e);
                }
                if (this.binding != null) {
                    binding.setValue(faces.getELContext(), instance);
                }
            }
            if (instance != null) {
                instance.processValueChange(event);
            }
        }
View Full Code Here

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

TOP

Related Classes of javax.faces.event.ValueChangeListener

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.