dandelion / dandelion-datatables

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

FilterDelay given as "integer" causes NullPointerException #318

Open klopc opened 7 years ago

klopc commented 7 years ago

Using dt:filterDelay="10000" will cause a NullPointerException in TableFilterDelayAttrProcessor as it will try to cast the given value, an int, into a BigDecimal.

(from AttributeUtils.processStandardExpression at : return result == null?null:(clazz.isAssignableFrom(result.getClass())?result:null);

Workaround is to use : dt:filterDelay="10000.0" which will work correctly, but is unintuitive and does not correspond to the documentation.

An easy fix would be to replace line 28 of TableFilterDelayAttrProcessor : BigDecimal attrValue = (BigDecimal)AttributeUtils.parseAttribute(arguments, element, attributeName, BigDecimal.class);

with : BigInteger attrValue = (BigInteger)AttributeUtils.parseAttribute(arguments, element, attributeName, BigInteger.class);