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 = null;
String type = inputDate.getType();
boolean ampm = inputDate.isAmpm();
String clientId = uiComponent.getClientId(facesContext);
if (null == inputDate.getConverter())
{
userData = (UserData) inputDate.getSubmittedValue();
if( userData == null )
userData = inputDate.getUserData(currentLocale);
}
else
{
//Use converter to get the value as string and
//create a UserData decoding it.
String value = org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.getStringValue(facesContext, inputDate);
//Create a UserData bean
userData = inputDate.getUserData(currentLocale);
if (null != value)
{
StringTokenizer st = new StringTokenizer(value,"\n");
while(st.hasMoreTokens())
{
String token = st.nextToken();
if (token.startsWith("year="))
{
userData.setYear(token.substring(5));
}
if (token.startsWith("month="))
{
userData.setYear(token.substring(6));
}
if (token.startsWith("day="))
{
userData.setYear(token.substring(4));
}
if (token.startsWith("hours="))
{
userData.setYear(token.substring(6));
}
if (token.startsWith("minutes="))
{
userData.setYear(token.substring(8));
}
if (token.startsWith("seconds="))
{
userData.setYear(token.substring(8));
}
if (token.startsWith("ampm="))
{
userData.setYear(token.substring(5));
}
}
}
}