문제

Is there a way to associate the PropertyEditor to a specific Controller.

I might want to have two PropertyEditor's for DateTime class, and want to associate them to different controllers.

or a domain class with 2 Date field, one need change 2010-12-23 to date, another need 2010-12-23 10:00:01

도움이 되었습니까?

해결책

There is no way to associate with a Controller. PropertyEditorRegistrar has only two signatures for registerCustomEditor(): for a whole property class, and for a property name. The second signature didn't work before Grails 1.3.6, it's a bug GRAILS-6592. So

registry.registerCustomEditor(Date.class, 'startDate', new MyDateAddressEditor())

will work since Grails 1.3.6.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top