Grails

Improve getting date from params

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.1-beta1
  • Fix Version/s: 1.2-M4
  • Component/s: Controllers, TagLib
  • Labels:
    None

Description

Related to http://www.nabble.com/getting-the-date-out-of-a-date-picker-td18016258.html#a18016258 I'm wondering if we can add some magic to retrieve a date from the params when submitting a datePicker.

For

<g:datePicker name="someDate" value="${myBean?.someDate}" ></g:datePicker>

It should be possible to just say:

def someDate = params.someDate

In the above mentioned post it's suggested to use a CommandObject.
The thing is you don't want a CommandObject every time.

Retrieving dates should be easier and more "DRY".

Activity

Hide
Dominic Clifton added a comment -

Agreed, if you're not using myObject.properties = params then you have to do too much work to get a date in three parts (y/m/d) into a date property.

Show
Dominic Clifton added a comment - Agreed, if you're not using myObject.properties = params then you have to do too much work to get a date in three parts (y/m/d) into a date property.
Hide
Graeme Rocher added a comment -

enough votes to make this a blocker

Show
Graeme Rocher added a comment - enough votes to make this a blocker
Hide
Graeme Rocher added a comment -

Done.

Show
Graeme Rocher added a comment - Done.
Hide
Marcel Overdijk added a comment -

Thanks!

How is the syntax, just something like:
def someDate = params.someDate

Show
Marcel Overdijk added a comment - Thanks! How is the syntax, just something like: def someDate = params.someDate
Hide
Graeme Rocher added a comment -

correct

Show
Graeme Rocher added a comment - correct

People

Vote (18)
Watch (12)

Dates

  • Created:
    Updated:
    Resolved: