Package javax.faces.event

Examples of javax.faces.event.ValueChangeListener


    // Regression test for bug #907
    public void testAttachedObjectsCount() throws Exception {
        Set<ValueChangeListener> returnedAttachedObjects = null,
                attachedObjects = new HashSet<ValueChangeListener>();
        ValueChangeListener toAdd = new TestValueChangeListener();
        attachedObjects.add(toAdd);
        toAdd = new TestValueChangeListener();
        attachedObjects.add(toAdd);
        toAdd = new TestValueChangeListener();
        attachedObjects.add(toAdd);
View Full Code Here


        input.addValueChangeListener
                (new TestValueChangeListener("PV1"));
        input.addValueChangeListener
                (new TestValueChangeListener("PV2"));

        ValueChangeListener listeners[] = input.getValueChangeListeners();
        assertEquals(5, listeners.length);
        input.removeValueChangeListener(listeners[2]);
        listeners = input.getValueChangeListeners();
        assertEquals(4, listeners.length);
View Full Code Here

        TestInput input = new TestInput();
        TestValueChangeListener listener = null;

        //No listeners added, should be empty
        ValueChangeListener listeners[] = input.getValueChangeListeners();
        assertEquals(0, listeners.length);

    }
View Full Code Here

        input.addValueChangeListener
            (new TestValueChangeListener("PV1"));
        input.addValueChangeListener
            (new TestValueChangeListener("PV2"));

        ValueChangeListener listeners[] = input.getValueChangeListeners();
        assertEquals(5, listeners.length);
        input.removeValueChangeListener(listeners[2]);
        listeners = input.getValueChangeListeners();
        assertEquals(4, listeners.length);
View Full Code Here

        TestInput input = new TestInput();
        TestValueChangeListener listener = null;

        //No listeners added, should be empty
        ValueChangeListener listeners[] = input.getValueChangeListeners();
  assertEquals(0, listeners.length);

    }
View Full Code Here

    protected boolean listenersAreEqual(FacesContext context,
          UIInput comp1,
          UIInput comp2) {

        ValueChangeListener list1[] = comp1.getValueChangeListeners();
        ValueChangeListener list2[] = comp2.getValueChangeListeners();
        assertNotNull(list1);
        assertNotNull(list2);
        assertEquals(list1.length, list2.length);
        for (int i = 0; i < list1.length; i++) {
            assertTrue(list1[i].getClass() == list2[i].getClass());
View Full Code Here

      .append("ValueChangeListener Listener is supposed to evaluate method")
      .append(expression.getExpressionString());
    }
    public boolean matches(Object argument) {
      if (argument instanceof ValueChangeListener) {
        ValueChangeListener listener = (ValueChangeListener) argument;
        ValueChangeEvent event = new ValueChangeEvent(new UIInput(), new Object(), new Object());
        listener.processValueChange(event);
        return expression.lastInvocationMatched(event);
      }
      return false;
    }
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

    }

    private ValueChangeListener _createValueChangeListener()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ValueChangeListener listener = null;
        // type and/or binding must be specified
        try
        {
            if (null != _binding)
            {
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.