xiaochong / zkui

Grails ZK UI Plugin
http://grails.org/plugin/zkui
GNU Lesser General Public License v3.0
24 stars 8 forks source link

renderErrorsAsMap added. Similar to renderErrors but instead of a domain class, it uses a list of maps. #61

Closed uris77 closed 12 years ago

uris77 commented 12 years ago

In a Composer, it is now possible to do: self.renderErrorsAsMap(bean:map) This does the same as renderErrors, but instead of taking domain class, it takes a list of maps. The map is structured as follows: [field: field, error: error]. This is useful whenever one is using an api that returns json , or a map.

xiaochong commented 12 years ago

Good,Your pull request is useful,but the method name "renderErrorsAsMap" is confused.

May be it's good to use "renderErrorsWithMap" or use polymorphic that use the same name "renderErrors".

uris77 commented 12 years ago

I agree, I realized that last night. I'm thinking of refactoring it out unto a class of its own so I can test it. Was also thinking of a name like : renderMapAsErrors. Suggestions are welcome.

xiaochong commented 12 years ago

The name "renderMapAsErrors" is good and refactoring it out unto a class of its own also a good idea.

Cheers