PrototypeProvider.getAjaxOptions() in JavascriptTagLib.groovy should be modified to allow params as a map, rather than requiring a string (but still provide support for the string).
the line:
ajaxOptions << "parameters:$
{options.remove('params')}
"
should be replaced with:
def params = options.remove('params')
if (params instanceof Map) {
ajaxOptions << "parameters:'" +
options.remove('params').collect { k, v -> "$
{k}
=$
{v}
" }.join('&') +
"'"
} else {
ajaxOptions << "parameters:'$
{params}
'"
}
To do the same functionality in DojoProvider, it seems that you would replace the following in doRemote():
attrs.params?.each
{k,v ->
out << ",$k:$v"
}
with:
if (attrs.params instanceof Map) {
attrs.params?.each
{k,v ->
out << ",$k:$v"
}
} else {
out << ",$
{attrs.params}
:''"
}
I've attached the resulting JavascriptTagLib.groovy (with old code commented out) because of the loss of indentation in the description text.