Package javax.faces.event

Examples of javax.faces.event.ValueChangeEvent


        ValueChange1 valueChange1 = new ValueChange1();
        userName.addValueChangeListener(valueChange1);

        // add value change event (containing the component) to the queue

        userName.queueEvent(new ValueChangeEvent(userName, "foo", "bar"));

        getFacesContext().getViewRoot().processValidators(getFacesContext());

        assertTrue(!System.getProperty(HANDLED_VALUEEVENT1).equals(EMPTY));
    }
View Full Code Here


        userName.addValueChangeListener(valueChange1);
        userName.addValueChangeListener(valueChange2);

        // add value change event (containing the component) to the queue

        userName.queueEvent(new ValueChangeEvent(userName, "foo", "bar"));

        getFacesContext().getViewRoot().processValidators(getFacesContext());

        assertTrue(!System.getProperty(HANDLED_VALUEEVENT1).equals(EMPTY));
        assertTrue(!System.getProperty(HANDLED_VALUEEVENT2).equals(EMPTY));
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 : "+_ComponentUtils.getPathToComponent(this),ex);
View Full Code Here

            assert org.jboss.seam.international.TimeZone.instance().equals(cet);
           
            TimeZoneSelector.instance().selectTimeZone("GMT");
            assert org.jboss.seam.international.TimeZone.instance().getID().equals("GMT");
           
            ValueChangeEvent valueChangeEvent = new ValueChangeEvent(new UIOutput(), "GMT", "PST");
            TimeZoneSelector.instance().select(valueChangeEvent);
            assert org.jboss.seam.international.TimeZone.instance().getID().equals("PST");
           
            // TODO Test cookie stuff (need to extend Mocks for this)
           
View Full Code Here

            assert org.jboss.seam.international.Locale.instance().equals(Locale.FRANCE);
           
            LocaleSelector.instance().selectLanguage(Locale.JAPANESE.getLanguage());
            assert org.jboss.seam.international.Locale.instance().getLanguage().equals(Locale.JAPANESE.getLanguage());
           
            ValueChangeEvent valueChangeEvent = new ValueChangeEvent(new UIOutput(), Locale.JAPANESE.toString(), Locale.TAIWAN.toString());
            LocaleSelector.instance().select(valueChangeEvent);
            assert org.jboss.seam.international.Locale.instance().equals(Locale.TAIWAN);
           
            Locale uk_posix = new Locale(Locale.UK.getLanguage(), Locale.UK.getCountry(), "POSIX");
            LocaleSelector.instance().setLocale(uk_posix);
View Full Code Here

    // Test event queuing and broadcasting (any phase listeners)
    public void testEventsGeneric() {

        UIInput input = (UIInput) component;
        ValueChangeEvent event = new ValueChangeEvent(input, null, null);

        // Register three listeners
        input.addValueChangeListener
                (new TestValueChangeListener("AP0"));
        input.addValueChangeListener
View Full Code Here

        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

        if (isValid()) {
            Object previous = getValue();
            setValue(newValue);
            setSubmittedValue(null);
            if (compareValues(previous, newValue)) {
                queueEvent(new ValueChangeEvent(this, previous, newValue));
            }
        }

    }
View Full Code Here

    private void uiInput_broadcast(FacesEvent event) {
        uiComponent_broadcast(event);
        if (!(event instanceof ValueChangeEvent))
            return;
        ValueChangeEvent valueChangeEvent = (ValueChangeEvent) event;

        ValueChangeListener[] valueChangeListeners = getValueChangeListeners();
        for (ValueChangeListener listener : valueChangeListeners) {

            listener.processValueChange(valueChangeEvent);
View Full Code Here

    // Test event queuing and broadcasting (any phase listeners)
    public void testEventsGeneric() {

        UIInput input = (UIInput) component;
        ValueChangeEvent event = new ValueChangeEvent(input, null, null);

        // Register three listeners
        input.addValueChangeListener
            (new TestValueChangeListener("AP0"));
        input.addValueChangeListener
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.