grails datepicker only provides default date to controller -
when effort utilize grails datepicker, when seek out page value gets sent controller default value, not actual date value i've chosen in datepicker fields.
i'm using grails datepicker in simple index.gsp page:
<g:form action="show"> game id: <g:textfield name="gameid" value=""/><br/> switch date: <g:datepicker name="switchdate" value="${new date()}"/><br/> <g:submitbutton name="submit" value="submit"/> </g:form>
my as simple show controller:
def show(long gameid, date switchdate) { println("gameid:$gameid switchdate:$switchdate") }
i'm guessing i'm missing obvious. give thanks in advance.
i think has date not beingness bound properly. if access through params.switchdate or alter parameter of type string:
def show(long gameid, string switchdate) { then works.
alternatively can follow steps this question set proper info binding date, i.e. setting:
grails.databinding.dateformats = ['mmddyyyy hh:mm:ss'] in config.groovy.
grails controller datepicker gsp
No comments:
Post a Comment