hi,
In version 2.0.9 I had a datetimepicker with custom user-defined
conversion that worked fine. After migrating
to S 2.1.1 my conversion class on submit receives the beginDate in the
wrong format, instead of the expected
"yyyy.MM.dd" I get something like dd-MM-yyyyT<time part>.
Seems like a defect new to 2.1.1 or?
Thanks in advance,
Best regards,
Giovanni
****************************** formSimulationRun.jsp *********************
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<s:form action="SimulationRun.action" method="post" theme="%{currentTheme}">
<sx:datetimepicker label="Begin Date" name="beginDate"
displayFormat="yyyy.MM.dd" toggleType="fade"
toggleDuration="500" />
...
<s:submit value="Simulate" align="center"/>
</s:form>
*********************** SimulationRunAction-conversion.properties
***********************
beginDate=com.sag.optimizer.ui.web.support.StringToDateConverter
endDate=com.sag.optimizer.ui.web.support.StringToDateConverter
*********************** StringToDateConverter.java
************************************
/**
* Custom conversion used by e.g. Simulation input form.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giovanni Azua</a>
* @version $ $Date: Oct 3, 2007 1:27:13 PM $
*/
public
class StringToDateConverter
extends StrutsTypeConverter
{
//------------------------------------------------------------------------
// public
//------------------------------------------------------------------------
@Override
public Object
convertFromString(Map aMap, String[] anArguments, Class aClass)
{
if (anArguments.length != 1)
{
super.performFallbackConversion(aMap, anArguments, aClass);
}
Integer myDate =
Integer.valueOf(anArguments[0].replaceAll("\\.", ""));
return myDate;
}
//------------------------------------------------------------------------
/**
* @throws UnsupportedOperationException "Not yet implemented."
*/
@Override
public String
convertToString(Map aMap, Object anArgument)
{
throws UnsupportedOperationException("Not yet implemented.");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]