Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlInputText


        rootComponent = new UIViewRoot();
        HtmlForm form = new HtmlForm();
        form.setId("form");
        rootComponent.getChildren().add(form);
        inputComponent1 = new HtmlInputText();
        form.getChildren().add(inputComponent1);
        inputComponent1.setId("input1");
        inputComponent2 = new HtmlInputText();
        form.getChildren().add(inputComponent2);
        inputComponent2.setId("input2");

        DateTimeConverter converter = new DateTimeConverter();
        converter.setPattern("DD/MM/yyyy");
View Full Code Here


        rootComponent = new UIViewRoot();
        HtmlForm form = new HtmlForm();
        form.setId("form");
        rootComponent.getChildren().add(form);
        inputComponent1 = new HtmlInputText();
        form.getChildren().add(inputComponent1);
        inputComponent1.setId("input1");
        inputComponent2 = new HtmlInputText();
        form.getChildren().add(inputComponent2);
        inputComponent2.setId("input2");

        DateTimeConverter converter = new DateTimeConverter();
        converter.setPattern("DD/MM/yyyy");
View Full Code Here

        HtmlForm form = new HtmlForm();
        form.setId("form");
        rootComponent.getChildren().add(form);

        //input1
        inputComponent1 = new HtmlInputText();
        inputComponent1.setId("input1");
        inputComponent1.setConverter(new DateTimeConverter());
        ((DateTimeConverter)inputComponent1.getConverter()).setPattern("dd.MM.yyyy");
        form.getChildren().add(inputComponent1);

        //input2
        inputComponent2 = new HtmlInputText();
        inputComponent2.setId("input2");
        inputComponent2.setConverter(new DateTimeConverter());
        ((DateTimeConverter)inputComponent2.getConverter()).setPattern("dd.MM.yyyy");
        form.getChildren().add(inputComponent2);
    }
View Full Code Here

        rootComponent = new UIViewRoot();
        HtmlForm form = new HtmlForm();
        form.setId("form");
        rootComponent.getChildren().add(form);
        inputComponent1 = new HtmlInputText();
        form.getChildren().add(inputComponent1);
        inputComponent1.setId("input1");
        inputComponent2 = new HtmlInputText();
        form.getChildren().add(inputComponent2);
        inputComponent2.setId("input2");
    }
View Full Code Here

        rootComponent = new UIViewRoot();
        HtmlForm form = new HtmlForm();
        form.setId("form");
        rootComponent.getChildren().add(form);
        inputComponent = new HtmlInputText();
        form.getChildren().add(inputComponent);
        inputComponent.setId("input1");
    }
View Full Code Here

    }
   
    @Override
    protected void createInputComponents(UIComponent parent, InputInfo ii, FacesContext context, List<UIComponent> compList)
    {
        HtmlInputText input;
    try {
      input = inputComponentClass.newInstance();
    } catch (InstantiationException e1) {
      throw new InternalException(e1);
    } catch (IllegalAccessException e2) {
      throw new InternalException(e2);
    }
        copyAttributes(parent, ii, input);
       
        int maxLength = 0;
        DataType type = ii.getColumn().getDataType();
        switch(type)
        {
            case CHAR:
            case TEXT:
                 maxLength = ((int) Math.round(ii.getColumn().getSize()));
                 break;
            case DECIMAL:
                 maxLength = ((int) Math.round(ii.getColumn().getSize()))+1;
                 break;
            default:
                 maxLength = 0;
        }
        if (maxLength>0)
            input.setMaxlength(maxLength);
       
        /*
        if (ii.getColumn().getName().equals("TITLE_DE"))
            log.info(ii.getColumn().getName());
        */   
           
        input.setDisabled(ii.isDisabled()); //  || ii.getColumn().isAutoGenerated()
        setInputValue(input, ii);
       
        compList.add(input);
    }
View Full Code Here

    this.jsfMock.facesContext().setViewRoot(viewToRender);

    UIForm form = new HtmlForm();
    form.setId("myForm");

    UIInput input = new HtmlInputText();
    input.setId("foo");

    form.getChildren().add(input);
    viewToRender.getChildren().add(form);

    RequestContextHolder.setRequestContext(this.context);
View Full Code Here

       
        //create a form 1
        UIComponent form1 = this.createForm("test1", root);
        
        //create a dummy component 1
        HtmlInputText component1 = createInputText("testRule1", form1);
        component1.setRequired(true);
              
        //create a required field/server rule
        CommonsValidator validator1 = createValidator(component1, "testRule1");
       
        //set the value
        component1.setSubmittedValue("blue");
       
        // invoke component validation
        component1.validate(facesContext);
           
        // check for a error message
        checkMessages(component1);
      
    }
View Full Code Here

       
        //create a form 1
        UIComponent form1 = this.createForm("test1", root);
        
        //create a dummy component 1
        HtmlInputText component1 = createInputText("testRule2", form1);
        component1.setRequired(true);
              
        //create a required field/server rule
        CommonsValidator validator1 = createValidator(component1, "testRule2");

        // <s:commonsValidator type="testRule2" message="{0} must be one of the following: {2}." arg="Favorite Color">
        //    <s:validatorVar name="enumerations" value="black, yellow, red"/>
        // </s:commonsValidator>
        validator1.getVars().put("enumerations", "black, yellow, red");
        validator1.setMessage("{0} must be one of the following: {2}.");
        validator1.setArg("Favorite Color");
       
        //set the value
        component1.setSubmittedValue("blue");
       
        // invoke component validation
        component1.validate(facesContext);
           
        // check for a error message
        checkMessage("Favorite Color must be one of the following: black, yellow, red.", component1);
      
    }
View Full Code Here

       
        //create a form 1
        UIComponent form1 = this.createForm("test1", root);
        
        //create a dummy component 1
        HtmlInputText component1 = createInputText("requiredField", form1);
        component1.setRequired(true);
              
        //create a required field/server rule
        CommonsValidator validator1 = createValidator(component1, "required");

      
        //create a form 2
        UIComponent form2 = this.createForm("test2", root);

        //create a dummy component 2
        HtmlInputText component2 = createInputText("requiredField", form2);
        component2.setRequired(true);
              
        //create a required field/server rule
        CommonsValidator validator2 = createValidator(component2, "required");
      
       
View Full Code Here

TOP

Related Classes of javax.faces.component.html.HtmlInputText

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.