you can modify the /simple/datetimepicker.ftl to check the dojo value for null 
e.g.
assuming your jsp references a nameValue parameter
<s:datetimepicker nameValue="" .../>

change
  <#if parameters.nameValue?if_exists != "">
    value="${parameters.nameValue?html}"<#rt/>
  </#if>

assyming you want the default to be 01/01/2001 change the assignment for value 
to
  <#if parameters.nameValue?if_exists != "">
    value="dojo.${parameters.nameValue?html:"01/01/2001"}"<#rt/>
    inputNameValue="${parameters.nameValue?html:"01/01/2001"}"<#rt/>
  </#if>

?
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


> Date: Fri, 15 Aug 2008 06:17:15 -0700
> From: [EMAIL PROTECTED]
> To: user@struts.apache.org
> Subject: Re: Datetimepicker conversion problem
> 
> 
> Hi All,
> 
> I managed to get a workaround and understands the problem a bit better now.
> 
> The displayFormat is not only used to format the date on the display side
> but is also used to format the data that comes from the action. If I specify
> a value, the registered converter will be called but the datepicker will
> still try to format according to the displayFormat, which is mostly not an
> issue but creates problems when my date is null. This happens because the
> null date is converted as an empty string which cannot be parsed according
> to the displayFormat.
> 
> The workaround is to change the tag to:
> <s:datetimepicker cssClass="text medium" name="miniSub.installDate"
> label="%{getText('miniSub.installDate')}"
>               displayFormat="%{getText('date.format')}" 
> value="%{miniSub.installDate ==
> null ? '00/00/00' : miniSub.installDate}"/>
> 
> This solves my problem but I think the date picker should not give
> exceptions when the value is set to a empty string.
> 
> Regards,
> 
> JC Oosthuizen
> 
> 
> JC Oosthuizen wrote:
> > 
> > Hi All,
> > 
> > I am using a datetimepicker on my jsp. The field containing the date is of
> > type org.joda.time.DateTime. Struts does not know how to convert DateTime
> > to and from Strings so I created my own Converter and it works fine when I
> > use a textfield, but gives me a ParseException when using a
> > datetimepicker.
> > 
> > The tag in my jsp looks as follows:
> > <s:datetimepicker cssClass="text medium" name="miniSub.installDate"
> > label="%{getText('miniSub.installDate')}"
> > displayFormat="%{getText('date.format')}"/>
> > 
> > When the page gets rendered the converter is called and the DateTime is
> > converted to a string, but that string is not used by the datetimepicker.
> > This causes a ParseException to occur.
> > 
> > How can I tell the datetimepicker to not try and convert the data on its
> > own but to use the registered converter to convert the data.
> > 
> > Regards,
> > JC Oosthuizen
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Datetimepicker-conversion-problem-tp18996354p18998475.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

_________________________________________________________________
Get thousands of games on your PC, your mobile phone, and the web with Windows®.
http://clk.atdmt.com/MRT/go/108588800/direct/01/

Reply via email to