« Return to Thread: Date not valid: date can be null?

Re: Date not valid: date can be null?

by Marcel Overdijk :: Rate this Message:

Reply to Author | View in Thread

I seem to have the same issue with rc1. This was not the case in previous versions.

I've created http://jira.codehaus.org/browse/GRAILS-1793.


Cheers,
Marcel

Alberto Gallen wrote:
Hi,

I need that the date can be null, and always get "Date not valid"

My example
---- Class Domain ------------
class Problem {
         String coment;
         Date fixDate=null;
       
         static constraints = {
                fixDate(nullable:true)
                coment(maxSize:255,blank:false)
        }
}
---- part of Controller --------------
def create = {
        def problem = new Problem()
        problem.properties = params
                problem.fixDate = null
        return ['problem':problem]
    }
------- View -------------------------

<g:datePicker name='fixDate' value=null noSelection="['':'---']">

alternative and different proven combinations:
        <g:datePicker name='fixDate' value="${null}" noSelection="['null':'---']">
       
Someone can help me with an example ?

Thank's in advance

--
Alberto Gallen
alberto.gallen (algarroba) gmail (punto) com

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

 « Return to Thread: Date not valid: date can be null?