You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Geoff Callender (JIRA)" <de...@tapestry.apache.org> on 2007/11/24 00:57:43 UTC
[jira] Created: (TAPESTRY-1927) Null date in Output with format
raises error
Null date in Output with format raises error
--------------------------------------------
Key: TAPESTRY-1927
URL: https://issues.apache.org/jira/browse/TAPESTRY-1927
Project: Tapestry
Issue Type: Bug
Components: tapestry-core
Affects Versions: 5.0.6
Reporter: Geoff Callender
Was this fixed at the same time as TAPESTRY-1871 and TAPESTRY-1870? The following code causes "Cannot format given Object as a Date" when expiryDate is null.
<td><t:output value="user.expiryDate" format="dateListFormat"/></td>
private DateFormat _dateListFormat = new SimpleDateFormat("dd/MM/yyyy");
public DateFormat getDateListFormat() {
return _dateListFormat;
}
A suggested fix: in beginRender(...) in the Output component, replace this:
String formatted = _format.format(_value);
with this:
String formatted = (_value == null ? "" : _format.format(_value));
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Closed: (TAPESTRY-1927) Null date in Output with format
raises error
Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-1927?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship closed TAPESTRY-1927.
------------------------------------------
Resolution: Duplicate
Assignee: Howard M. Lewis Ship
Duplicate of TAPESTRY-1871.
> Null date in Output with format raises error
> --------------------------------------------
>
> Key: TAPESTRY-1927
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1927
> Project: Tapestry
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.0.6
> Reporter: Geoff Callender
> Assignee: Howard M. Lewis Ship
>
> Was this fixed at the same time as TAPESTRY-1871 and TAPESTRY-1870? The following code causes "Cannot format given Object as a Date" when expiryDate is null.
> <td><t:output value="user.expiryDate" format="dateListFormat"/></td>
> private DateFormat _dateListFormat = new SimpleDateFormat("dd/MM/yyyy");
> public DateFormat getDateListFormat() {
> return _dateListFormat;
> }
> A suggested fix: in beginRender(...) in the Output component, replace this:
> String formatted = _format.format(_value);
> with this:
> String formatted = (_value == null ? "" : _format.format(_value));
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org