Package org.apache.myfaces.custom.date.HtmlInputDate

Examples of org.apache.myfaces.custom.date.HtmlInputDate.UserData


    public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException {
        RendererUtils.checkParamValidity(facesContext, uiComponent, HtmlInputDate.class);

        HtmlInputDate inputDate = (HtmlInputDate) uiComponent;
        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null )
            userData = inputDate.getUserData(currentLocale);
        String type = inputDate.getType();
        String clientId = uiComponent.getClientId(facesContext);
View Full Code Here


   
        if( isDisabled(facesContext, inputDate) ) // For safety, do not set the submited value if the component is disabled.
            return;

        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null ) {
            userData = inputDate.getUserData(currentLocale);
        } else {
          inputDate.setUserData(userData);
        }
        String clientId = inputDate.getClientId(facesContext);
        String type = inputDate.getType();
        Map requestMap = facesContext.getExternalContext().getRequestParameterMap();

        if( ! type.equals( "time" ) ){
            userData.setDay( (String) requestMap.get(clientId + ID_DAY_POSTFIX) );
            userData.setMonth( (String) requestMap.get(clientId + ID_MONTH_POSTFIX) );
            userData.setYear( (String) requestMap.get(clientId + ID_YEAR_POSTFIX) );
        }
       
        if( ! type.equals( "date" ) ){
            userData.setHours( (String) requestMap.get(clientId + ID_HOURS_POSTFIX) );
            userData.setMinutes( (String) requestMap.get(clientId + ID_MINUTES_POSTFIX) );
            if (type.equals("full") || type.equals("time"))
              userData.setSeconds( (String) requestMap.get(clientId + ID_SECONDS_POSTFIX) );
        }

        inputDate.setSubmittedValue( userData );
    }
View Full Code Here

        inputDate.setSubmittedValue( userData );
    }
   
    public Object getConvertedValue(FacesContext context, UIComponent uiComponent, Object submittedValue) throws ConverterException {
        UserData userData = (UserData) submittedValue;
        try {
            return userData.parse();
        } catch (ParseException e) {
            Object[] args = {uiComponent.getId()};
            throw new ConverterException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, DATE_MESSAGE_ID, args));
        }
    }
View Full Code Here

    public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException {
        RendererUtils.checkParamValidity(facesContext, uiComponent, HtmlInputDate.class);

        HtmlInputDate inputDate = (HtmlInputDate) uiComponent;
        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null )
            userData = inputDate.getUserData(currentLocale);
        String type = inputDate.getType();
        boolean ampm = inputDate.isAmpm();
        String clientId = uiComponent.getClientId(facesContext);
View Full Code Here

        if( isDisabled(facesContext, inputDate) ) // For safety, do not set the submited value if the component is disabled.
            return;

        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null )
            userData = inputDate.getUserData(currentLocale);

        String clientId = inputDate.getClientId(facesContext);
        String type = inputDate.getType();
        Map requestMap = facesContext.getExternalContext().getRequestParameterMap();

        if( ! (type.equals( "time" ) || type.equals( "short_time" )) ){
            userData.setDay( (String) requestMap.get(clientId + ID_DAY_POSTFIX) );
            userData.setMonth( (String) requestMap.get(clientId + ID_MONTH_POSTFIX) );
            userData.setYear( (String) requestMap.get(clientId + ID_YEAR_POSTFIX) );
        }

        if( ! type.equals( "date" ) ){
            userData.setHours( (String) requestMap.get(clientId + ID_HOURS_POSTFIX) );
            userData.setMinutes( (String) requestMap.get(clientId + ID_MINUTES_POSTFIX) );
            if (type.equals("full") || type.equals("time"))
        userData.setSeconds( (String) requestMap.get(clientId + ID_SECONDS_POSTFIX) );

            if (inputDate.isAmpm()) {
              userData.setAmpm( (String) requestMap.get(clientId + ID_AMPM_POSTFIX) );
            }
        }
        inputDate.setSubmittedValue( userData );
    }
View Full Code Here

        }
        inputDate.setSubmittedValue( userData );
    }

    public Object getConvertedValue(FacesContext context, UIComponent uiComponent, Object submittedValue) throws ConverterException {
        UserData userData = (UserData) submittedValue;
        try {
            return userData.parse();
        } catch (ParseException e) {
            Object[] args = {uiComponent.getId()};
            throw new ConverterException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, DATE_MESSAGE_ID, args));
        }
    }
View Full Code Here

    public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException {
        RendererUtils.checkParamValidity(facesContext, uiComponent, HtmlInputDate.class);

        HtmlInputDate inputDate = (HtmlInputDate) uiComponent;
        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null )
            userData = inputDate.getUserData(currentLocale);
        String type = inputDate.getType();
        String clientId = uiComponent.getClientId(facesContext);
View Full Code Here

   
        if( isDisabled(facesContext, inputDate) ) // For safety, do not set the submited value if the component is disabled.
            return;

        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null )
            userData = inputDate.getUserData(currentLocale);
        String clientId = inputDate.getClientId(facesContext);
        String type = inputDate.getType();
        Map requestMap = facesContext.getExternalContext().getRequestParameterMap();

        if( ! type.equals( "time" ) ){
            userData.setDay( (String) requestMap.get(clientId + ID_DAY_POSTFIX) );
            userData.setMonth( (String) requestMap.get(clientId + ID_MONTH_POSTFIX) );
            userData.setYear( (String) requestMap.get(clientId + ID_YEAR_POSTFIX) );
        }
       
        if( ! type.equals( "date" ) ){
            userData.setHours( (String) requestMap.get(clientId + ID_HOURS_POSTFIX) );
            userData.setMinutes( (String) requestMap.get(clientId + ID_MINUTES_POSTFIX) );
            if (type.equals("full") || type.equals("time"))
              userData.setSeconds( (String) requestMap.get(clientId + ID_SECONDS_POSTFIX) );
        }

        inputDate.setSubmittedValue( userData );
    }
View Full Code Here

        inputDate.setSubmittedValue( userData );
    }
   
    public Object getConvertedValue(FacesContext context, UIComponent uiComponent, Object submittedValue) throws ConverterException {
        UserData userData = (UserData) submittedValue;
        try {
            return userData.parse();
        } catch (ParseException e) {
            Object[] args = {uiComponent.getId()};
            throw new ConverterException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, DATE_MESSAGE_ID, args));
        }
    }
View Full Code Here

    public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException {
        RendererUtils.checkParamValidity(facesContext, uiComponent, HtmlInputDate.class);

        HtmlInputDate inputDate = (HtmlInputDate) uiComponent;
        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null )
            userData = inputDate.getUserData(currentLocale);
        String type = inputDate.getType();
        String clientId = uiComponent.getClientId(facesContext);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.custom.date.HtmlInputDate.UserData

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.