Package javax.faces.event

Examples of javax.faces.event.ValueChangeEvent


        UIInput input = (UIInput) component;
  input.setRendererType(null);
  UIViewRoot root = facesContext.getApplication().getViewHandler().createView(facesContext, null);
  root.getChildren().add(input);
        ValueChangeEvent event  = null;
 
        // Register three listeners
        input.addValueChangeListener
            (new TestValueChangeListener("ARV"));
        input.addValueChangeListener
            (new TestValueChangeListener("PV"));
        input.addValueChangeListener
            (new TestValueChangeListener("AP"));

        TestValueChangeListener.trace(null);
  event = new ValueChangeEvent(input, null, null);
  event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
  input.queueEvent(event);

  event = new ValueChangeEvent(input, null, null);
  event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
  input.queueEvent(event);

  event = new ValueChangeEvent(input, null, null);
  event.setPhaseId(PhaseId.INVOKE_APPLICATION);
  input.queueEvent(event);

        // Fire events and evaluate results
  root.processDecodes(facesContext);
  root.processValidators(facesContext);
View Full Code Here


      .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

            Object previousValue = getValue();
            setValue(convertedValue);
            setSubmittedValue(null);
            if (compareValues(previousValue, convertedValue))
            {
                queueEvent(new ValueChangeEvent(this, previousValue, convertedValue));
            }
        }
        catch (Exception ex)
        {
            throw new FacesException("Exception while validating component with path : "
View Full Code Here

        text1.pushComponentToEL(facesContext, text1);
        text1.getValidators()[0].validate(facesContext, text1, "");
        text1.popComponentFromEL(facesContext);

        text2.pushComponentToEL(facesContext, text2);
        text2.getValueChangeListeners()[0].processValueChange(new ValueChangeEvent(text2, "old", "new"));
        text2.popComponentFromEL(facesContext);

        form.popComponentFromEL(facesContext);
        facet2.popComponentFromEL(facesContext);
        compositeComponent2.popComponentFromEL(facesContext);
View Full Code Here

        Object previousValue = getValue();
        setValue(convertedValue);
        setSubmittedValue(null);
        if (compareValues(previousValue, convertedValue))
        {
            queueEvent(new ValueChangeEvent(this, previousValue, convertedValue));
        }
    }
View Full Code Here

        text1.pushComponentToEL(facesContext, text1);
        text1.getValidators()[0].validate(facesContext, text1, "");
        text1.popComponentFromEL(facesContext);

        text2.pushComponentToEL(facesContext, text2);
        text2.getValueChangeListeners()[0].processValueChange(new ValueChangeEvent(text2, "old", "new"));
        text2.popComponentFromEL(facesContext);

        form.popComponentFromEL(facesContext);
        facet2.popComponentFromEL(facesContext);
        compositeComponent2.popComponentFromEL(facesContext);
View Full Code Here

        Object previousValue = getValue();
        setValue(convertedValue);
        setSubmittedValue(null);
        if (compareValues(previousValue, convertedValue))
        {
            queueEvent(new ValueChangeEvent(this, previousValue, convertedValue));
        }
    }
View Full Code Here

        Assert.assertNotNull(input1);
        Assert.assertNotNull(input1.getValueChangeListeners());
        Assert.assertEquals(1, input1.getValueChangeListeners().length);
       
        bean.setValueChangeListener1Called(false);
        input1.getValueChangeListeners()[0].processValueChange(new ValueChangeEvent(input1,"x","y"));
        Assert.assertTrue(bean.isValueChangeListener1Called());

        UIComponent panelGroup2 = root.findComponent("testGroup2");
        Assert.assertNotNull(panelGroup2);
        UINamingContainer compositeComponent2 = (UINamingContainer) panelGroup2.getChildren().get(0);
        Assert.assertNotNull(compositeComponent2);
        UIInput input2 = (UIInput) compositeComponent2.findComponent("testComponent");
        Assert.assertNotNull(input2);
        Assert.assertNotNull(input2.getValueChangeListeners());
        Assert.assertEquals(1, input2.getValueChangeListeners().length);
       
        bean.setValueChangeListener2Called(false);
        input2.getValueChangeListeners()[0].processValueChange(new ValueChangeEvent(input2,"x","y"));
        Assert.assertTrue(bean.isValueChangeListener2Called());
    }
View Full Code Here

        Assert.assertNotNull(input1);
        Assert.assertNotNull(input1.getValueChangeListeners());
        Assert.assertEquals(1, input1.getValueChangeListeners().length);
       
        bean.setValueChangeListener1Called(false);
        input1.getValueChangeListeners()[0].processValueChange(new ValueChangeEvent(input1,"x","y"));
        Assert.assertTrue(bean.isValueChangeListener1Called());

        UIComponent panelGroup2 = root.findComponent("testGroup2");
        Assert.assertNotNull(panelGroup2);
        UINamingContainer compositeComponent2 = (UINamingContainer) panelGroup2.getChildren().get(0);
        Assert.assertNotNull(compositeComponent2);
       
        UINamingContainer compositeComponent2inner = (UINamingContainer) compositeComponent2.findComponent("simpleAttributeMethodExpressionTarget");
        Assert.assertNotNull(compositeComponent2inner);
        UIInput input2 = (UIInput) compositeComponent2inner.findComponent("testComponent");
        Assert.assertNotNull(input2);
        Assert.assertNotNull(input2.getValueChangeListeners());
        Assert.assertEquals(1, input2.getValueChangeListeners().length);
       
        bean.setValueChangeListener2Called(false);
        input2.getValueChangeListeners()[0].processValueChange(new ValueChangeEvent(input2,"x","y"));
        Assert.assertTrue(bean.isValueChangeListener2Called());

    }
View Full Code Here

        Assert.assertNotNull(input1);
        Assert.assertNotNull(input1.getValueChangeListeners());
        Assert.assertEquals(1, input1.getValueChangeListeners().length);
       
        bean.setValueChangeListener1Called(false);
        input1.getValueChangeListeners()[0].processValueChange(new ValueChangeEvent(input1,"x","y"));
        Assert.assertTrue(bean.isValueChangeListener1Called());
       
        UIInput input1n = (UIInput) compositeComponent1.findComponent("testComponentNoTarget");
       
        Assert.assertNotNull(input1n);
        Assert.assertNotNull(input1n.getValueChangeListeners());
        Assert.assertEquals(1, input1n.getValueChangeListeners().length);
       
        compositeComponent1.pushComponentToEL(facesContext, compositeComponent1);
        bean.setValueChangeListener1Called(false);
        input1n.getValueChangeListeners()[0].processValueChange(new ValueChangeEvent(input1n,"x","y"));
        Assert.assertTrue(bean.isValueChangeListener1Called());
        compositeComponent1.popComponentFromEL(facesContext);
       
        UIComponent panelGroup2 = root.findComponent("testGroup2");
        Assert.assertNotNull(panelGroup2);
        UINamingContainer compositeComponent2 = (UINamingContainer) panelGroup2.getChildren().get(0);
        Assert.assertNotNull(compositeComponent2);
        UIInput input2 = (UIInput) compositeComponent2.findComponent("testComponent");
        Assert.assertNotNull(input2);
        Assert.assertNotNull(input2.getValueChangeListeners());
        Assert.assertEquals(1, input2.getValueChangeListeners().length);
       
        bean.setValueChangeListener2Called(false);
        input2.getValueChangeListeners()[0].processValueChange(new ValueChangeEvent(input2,"x","y"));
        Assert.assertTrue(bean.isValueChangeListener2Called());
       
        UIInput input2n = (UIInput) compositeComponent2.findComponent("testComponentNoTarget");
       
        Assert.assertNotNull(input2n);
        Assert.assertNotNull(input2n.getValueChangeListeners());
        Assert.assertEquals(1, input2n.getValueChangeListeners().length);
       
        compositeComponent2.pushComponentToEL(facesContext, compositeComponent2);
        bean.setValueChangeListener2Called(false);
        input2n.getValueChangeListeners()[0].processValueChange(new ValueChangeEvent(input2n,"x","y"));
        Assert.assertTrue(bean.isValueChangeListener2Called());
        compositeComponent2.popComponentFromEL(facesContext);
    }
View Full Code Here

TOP

Related Classes of javax.faces.event.ValueChangeEvent

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.