|
It appears that the built-in Date property editor is dysfunctional in grails 2.0.3. As I understand it, by default grails sets up a StructuredDateEditor for java.util.Date and java.sql.Date properties, and that StructuredDateEditor expects a parameter that matches the property name and the value "struct" and then 5 more operties of the form propertyName_field where field is one of [year, month, day, hour, minute]. I looked at the source code so I am certain I have the field name correct. The params that are sent with my request are as follows (only startDate and endDate are relevant to this issue): params = [startDate:struct, adviseLargeData:1.66914, daysOccupied:[1, 1, 1, 1, 1, 1, 1], activeFilter:GEO, startDate_hour:0, endDate:struct, building.id:1, building:[id:1], floor.id:19, floor:[id:19], endDate_month:6, endDate_day:25, endDate_minute:0, endDate_year:2012, endDate_hour:0, account.id:1, account:[id:1], startDate_month:6, endOccupied:2400, startDate_day:19, startOccupied:0, outputOfInterest:VAV_SpaceTemp, startDate_year:2012, analysisType:spectral, selectedEspaces:[173, 163, 201], startDate_minute:0, campus.id:1, campus:[id:1], action:newPerformAnalysis, controller:main] Looking at my command object after binding, both startDate and endDate are still null, but I don't understand why that is the case. performAnalysis command AnalysisCommand@715c80b8[account=[Account id:1, name:'IH'],campus=[Campus id:1, name:'IH Campus', account:'IH'],building=[Building id:1, name:'secret', campus:'IH Campus'],floorId=[Floor id:19, name:'Cellar Floor Mezzanine', building:'secret', perimeter: POLYGON ((23 91, 2598 91, 2610 1030, 23 1030, 23 91))],outputOfInterest=VAV_SpaceTemp,startDate=<null>,endDate=<null>,startOccupied=0,endOccupied=2400,occupiedHours=true,analysisType=spectral,adviseLargeData=1.66914,selectedEspaces=[173, 163, 201],daysOccupied=[1, 1, 1, 1, 1, 1, 1]] There are no binding errors reported, so it isn't encountering an error in the property editor that I can see. It either isn't firing the editor, or the editor is somehow failing to generate a Date object.
Does anyone have any idea what I'm doing wrong? Due to the apparent inability to assign custom property editors on a per-controller or per-action basis, I can't easily just throw a DateFormat-based property editor into the mix, so I went through great pains to set up the fields via javascript prior to sending my request from the browser, but it appears to have been a lot of work for no reward. Or do I have to manually assign the StructuredDateEditor? In which case, what is the default editor for java.util.Date properties?
|
| Powered by Nabble | Edit this page |
