Hi!
I look the code and try something
public int compare(Object o1, Object o2)
{
int index1 = ((Integer) o1).intValue();
int index2 = ((Integer) o2).intValue();
_model.setRowIndex(index1);
Object value1 = getPropertyValue(_prop);
_model.setRowIndex(index2);
Object value2 = getPropertyValue(_prop);
if (value1 == null)
return (value2 == null) ? 0 : -1;
if (value2 == null)
return 1;
//my code
if(value1 instanceof java.lang.String){
Collator collator = Collator.getInstance(
FacesContext.getCurrentInstance().getViewRoot().getLocale());
collator.setStrength(Collator.PRIMARY);
return collator.compare(value1, value2);
}
//end my code
// ?? Sometimes, isSortable returns true
// even if the underlying object is not a Comparable.
// This happens if the object at rowIndex zero is null.
// So test before we cast:
if (value1 instanceof Comparable)
{
return ((Comparable) value1).compareTo(value2);
}
else
{
// if the object is not a Comparable, then
// the best we can do is string comparison:
return value1.toString().compareTo(value2.toString());
}
}
I don't now how to report to jira, could you be so kind and do it?
When will change be avaiable for download and where?
Thanks lot. This will reduce my code for about 10 % :)
--
View this message in context:
http://www.nabble.com/datatable-sortable-order-problem-for-non-english-languages-tf3019397.html#a8410212
Sent from the My Faces - Dev mailing list archive at Nabble.com.