protected void renderInputBegin()

in myfaces-html5-core/src/main/java/org/apache/myfaces/html5/renderkit/input/HtmlInputDateTimeRenderer.java [109:147]


    protected void renderInputBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException
    {
        RendererUtils.checkParamValidity(facesContext, uiComponent, HtmlInputDateTime.class);
        HtmlInputDateTime component = (HtmlInputDateTime) uiComponent;

        if (RendererUtils.findUIOutputConverter(facesContext, component) == null)
        {
            component.setConverter(new Html5DateTimeConverter());
        }

        _checkInputHtmlType(uiComponent);
        super.renderInputBegin(facesContext, uiComponent);

        ResponseWriter writer = facesContext.getResponseWriter();

        // XXX: support the symbols of java.text.SimpleDateFormat later. it is kind of confusing.
        double step = component.getStep();
        if (step == Double.MIN_VALUE) // means not specified
        {
            writer.writeAttribute(HTML5.STEP_ATTR, DEFAULT_STEP_HTML_VALUE, JsfProperties.STEP_PROP);
        }
        else if (step < 0)
        {
            throw new FacesException("'step' cannot be negative for component "
                    + DebugUtils.getPathToComponent(uiComponent) + ". Provided " + step);
        }
        else
        {
            writer.writeAttribute(HTML5.STEP_ATTR, step, JsfProperties.STEP_PROP);
        }

        String strMinimum = _getMinimumStr(component);
        if (strMinimum != null)
            writer.writeAttribute(HTML5.MIN_ATTR, strMinimum, null);

        String strMaximum = _getMaximumStr(component);
        if (strMaximum != null)
            writer.writeAttribute(HTML5.MAX_ATTR, strMaximum, null);
    }