Package javax.faces.component

Examples of javax.faces.component.UIInput$ValueChangeListenerAdapter


        Assert.assertNull(button.getAttributes().get("metodo"));
       
        UICommand link = (UICommand) compositeComponent.findComponent("link");
        Assert.assertNotNull(link);
        Assert.assertEquals(1, link.getActionListeners().length);
        UIInput input = (UIInput) compositeComponent.findComponent("input");
        Assert.assertNotNull(input);
        Assert.assertEquals(1, input.getValidators().length);
        Assert.assertEquals(1, input.getValueChangeListeners().length);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);
       
View Full Code Here


        {
            if(inputCalendar.isAddResources())
                addScriptAndCSSResources(facesContext, component);

             // Check for an enclosed converter:
             UIInput uiInput = (UIInput) component;
             Converter converter = uiInput.getConverter();
             String dateFormat = null;
             if (converter != null && converter instanceof DateTimeConverter) {
                 dateFormat = ((DateTimeConverter) converter).getPattern();
             }
             if (dateFormat == null) {
View Full Code Here

    public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue) throws ConverterException
    {
        RendererUtils.checkParamValidity(facesContext, uiComponent, HtmlInputCalendar.class);

        UIInput uiInput = (UIInput) uiComponent;

        Converter converter = uiInput.getConverter();

        if(converter==null)
            converter = new CalendarDateTimeConverter();

        if (submittedValue != null && !(submittedValue instanceof String))
View Full Code Here

    private UIComponent innerGetDelegate()
    {
        if(delegate==null)
        {
            delegate = new UIInput();
        }

        return delegate;
    }
View Full Code Here

    public void setUp() throws Exception {
        super.setUp();

        // Create mock DataAdaptor and childs.
        adaptor = new MockDataAdaptor();
        child = new UIInput() {
            public void processDecodes(FacesContext context) {
                childInvoked++;
                super.processDecodes(context);
            }
        };
        childInvoked = 0;
        child.setId("child");
        adaptor.getChildren().add(child);
        facetChild = new UIInput() {
            public void processDecodes(FacesContext context) {
                facetInvoked++;
                super.processDecodes(context);
            }
        };
        facetInvoked = 0;
        facetChild.setId("facetChild");
        adaptor.getFacets().put("facet", facetChild);
        childChild = new UIInput() {
            public void processDecodes(FacesContext context) {
                childChildInvoked++;
                super.processDecodes(context);
            }
        };
        ;
        childChildInvoked = 0;
        childChild.setId("childChild");
        child.getChildren().add(childChild);
        childChildFacet = new UIInput() {
            public void processDecodes(FacesContext context) {
                childChildFacetInvoked++;
                super.processDecodes(context);
            }
        };
View Full Code Here

{
    public String enableValidation()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();

        UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number1");
        Validator[] validators = number1.getValidators();
        if (validators == null || validators.length == 0)
        {
            number1.addValidator(new LongRangeValidator(10, 1));
        }

        UIInput number2 = (UIInput)facesContext.getViewRoot().findComponent("form1:number2");
        validators = number2.getValidators();
        if (validators == null || validators.length == 0)
        {
            number2.addValidator(new LongRangeValidator(50, 20));
        }

        UIInput text = (UIInput)facesContext.getViewRoot().findComponent("form2:text");
        validators = text.getValidators();
        if (validators == null || validators.length == 0)
        {
            text.addValidator(new LengthValidator(7, 3));
        }

        return "ok";
    }
View Full Code Here

    public String disableValidation()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();

        UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number1");
        Validator[] validators = number1.getValidators();
        if (validators != null)
        {
            for (int i = 0; i < validators.length; i++)
            {
                Validator validator = validators[i];
                number1.removeValidator(validator);
            }
        }

        UIInput number2 = (UIInput)facesContext.getViewRoot().findComponent("form1:number2");
        validators = number2.getValidators();
        if (validators != null)
        {
            for (int i = 0; i < validators.length; i++)
            {
                Validator validator = validators[i];
                number2.removeValidator(validator);
            }
        }

        UIInput text = (UIInput)facesContext.getViewRoot().findComponent("form2:text");
        validators = text.getValidators();
        if (validators != null)
        {
            for (int i = 0; i < validators.length; i++)
            {
                Validator validator = validators[i];
                text.removeValidator(validator);
            }
        }

        return "ok";
    }
View Full Code Here

    }

    public String getNumber2ValidationLabel()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number2");
        Validator[] validators = number1.getValidators();
        if (validators != null && validators.length > 0)
        {
            long min = ((LongRangeValidator)validators[0]).getMinimum();
            long max = ((LongRangeValidator)validators[0]).getMaximum();
            return " (" + min + "-" + max + ")";
View Full Code Here

    }

    public String getTextValidationLabel()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form2:text");
        Validator[] validators = number1.getValidators();
        if (validators != null && validators.length > 0)
        {
            long min = ((LengthValidator)validators[0]).getMinimum();
            long max = ((LengthValidator)validators[0]).getMaximum();
            return " (" + min + "-" + max + " chars)";
View Full Code Here

    public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue) throws ConverterException
    {
        RendererUtils.checkParamValidity(facesContext, uiComponent, HtmlInputCalendar.class);

        UIInput uiInput = (UIInput) uiComponent;

        Converter converter = uiInput.getConverter();

        if(converter==null)
            converter = new CalendarDateTimeConverter();

        if (!(submittedValue == null || submittedValue instanceof String))
View Full Code Here

TOP

Related Classes of javax.faces.component.UIInput$ValueChangeListenerAdapter

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.