Author: konstantin.mishin
Date: 2009-07-31 12:14:58 -0400 (Fri, 31 Jul 2009)
New Revision: 15085
Modified:
branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
Log:
RF-7545
Modified:
branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
---
branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2009-07-31
16:12:54 UTC (rev 15084)
+++
branches/community/3.3.X/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2009-07-31
16:14:58 UTC (rev 15085)
@@ -119,25 +119,24 @@
}
sortFields.addAll(sortFieldsMap.values());
ExtendedDataModel dataModel = super.createDataModel();
- if ((filterFields != null && !filterFields.isEmpty())
- || (sortFields != null && !sortFields.isEmpty())) {
- Modifiable modifiable = null;
- if (dataModel instanceof Modifiable) {
- modifiable = (Modifiable) dataModel;
- } else {
- ModifiableModel modifiableModel = new ModifiableModel(dataModel, getVar());
- dataModel = modifiableModel;
- modifiable = modifiableModel;
+ Modifiable modifiable = null;
+ if (dataModel instanceof Modifiable) {
+ modifiable = (Modifiable) dataModel;
+ } else if (!filterFields.isEmpty() || !sortFields.isEmpty()) {
+ ModifiableModel modifiableModel = new ModifiableModel(dataModel, getVar());
+ dataModel = modifiableModel;
+ modifiable = modifiableModel;
+ }
+
+ if (dataModel instanceof LocaleAware) {
+ FacesContext facesContext = getFacesContext();
+ if (ContextInitParameters.isDatatableUsesViewLocale(facesContext)) {
+ UIViewRoot viewRoot = facesContext.getViewRoot();
+ ((LocaleAware) dataModel).setLocale(viewRoot.getLocale());
}
-
- if (dataModel instanceof LocaleAware) {
- FacesContext facesContext = getFacesContext();
- if (ContextInitParameters.isDatatableUsesViewLocale(facesContext)) {
- UIViewRoot viewRoot = facesContext.getViewRoot();
- ((LocaleAware) dataModel).setLocale(viewRoot.getLocale());
- }
- }
-
+ }
+
+ if (modifiable != null) {
modifiable.modify(filterFields, sortFields);
}
return dataModel;
Show replies by date