You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Andera Del Bene (JIRA)" <ji...@apache.org> on 2011/03/30 16:01:06 UTC

[jira] [Commented] (WICKET-3569) DateField is broken

    [ https://issues.apache.org/jira/browse/WICKET-3569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012966#comment-13012966 ] 

Andera Del Bene commented on WICKET-3569:
-----------------------------------------

I think that this behavior is due to the following code lines from class DateTimeField.java

      @Override
	protected void convertInput()
	{
		try
		{
			// Get the converted input values
			Date dateFieldInput = dateField.getConvertedInput();
			Integer hoursInput = hoursField.getConvertedInput();
			Integer minutesInput = minutesField.getConvertedInput();
			AM_PM amOrPmInput = amOrPmChoice.getConvertedInput();

			// Default with "now"
			if (dateFieldInput == null)
			{
				dateFieldInput = new Date();
			}


but I don't know why "now" was chosen as default value.

> DateField is broken
> -------------------
>
>                 Key: WICKET-3569
>                 URL: https://issues.apache.org/jira/browse/WICKET-3569
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC2
>            Reporter: Jim Larsen
>
> org.apache.wicket.extensions.yui.calendar.DateField 
> When submitting form with empty date field (null date in model), the model is set to current date.
> dateField.getModelObject() return currentDate
> dateField.getDate() returns null.
> This is a major problem ie in a CompoundPropertyModel where all null dates will be set to currentDate.
> Using a DateTextField and adding a DatePicker to this, does not have same problem.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira