dandelion / dandelion-datatables

Dandelion component for DataTables
http://dandelion.github.io/components/datatables/
Other
110 stars 49 forks source link

StandardConfigurationLoader non string values bug #258

Closed ztomic closed 10 years ago

ztomic commented 10 years ago

StandardConfigurationLoader loads all values as strings in userConf, so if for e.g. global.ajax.serverSide is set to true in datatables.properties and table does not have dt:serverSide="true" then ClassCastException is thrown in AjaxSourceProcessor.

(https://github.com/dandelion/dandelion-datatables/blob/master/datatables-core/src/main/java/com/github/dandelion/datatables/core/configuration/StandardConfigurationLoader.java#L267)

As temporary fix I'm using changed StandardConfigurationLoader with following change at line 267 (only for ajax.serverSide):

if (configToken.getPropertyName().endsWith("ajax.serverSide")) {
    userConf.put(configToken, Boolean.valueOf(entry.getValue() + ""));
} else {
    userConf.put(configToken, entry.getValue().toString());
}
tduchateau commented 10 years ago

You're absolutely right. Reproduced. Thanks a lot for this one!

ztomic commented 10 years ago

No problem :)

tduchateau commented 10 years ago

Raised in: http://dandelion-forum.48353.x6.nabble.com/v0-10-1-ajax-serverSide-true-lt-Boolean-Parse-Exception-td1660.html And in: http://dandelion-forum.48353.x6.nabble.com/v0-10-0-ClassCastException-when-global-ajax-pipelining-is-set-to-true-tp1504p1647.html