Author: dsvyatobatsko
Date: 2009-02-11 15:30:56 -0500 (Wed, 11 Feb 2009)
New Revision: 12633
Modified:
trunk/ui/dataFilterSlider/src/main/java/org/richfaces/component/UIDataFltrSlider.java
trunk/ui/dataFilterSlider/src/main/java/org/richfaces/renderkit/DataFilterSliderRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-6144
Modified:
trunk/ui/dataFilterSlider/src/main/java/org/richfaces/component/UIDataFltrSlider.java
===================================================================
---
trunk/ui/dataFilterSlider/src/main/java/org/richfaces/component/UIDataFltrSlider.java 2009-02-11
18:19:42 UTC (rev 12632)
+++
trunk/ui/dataFilterSlider/src/main/java/org/richfaces/component/UIDataFltrSlider.java 2009-02-11
20:30:56 UTC (rev 12633)
@@ -26,7 +26,6 @@
import java.util.List;
import java.util.Map;
-import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
import javax.faces.context.FacesContext;
@@ -35,7 +34,7 @@
import javax.faces.event.FacesEvent;
import javax.faces.model.ListDataModel;
-import org.ajax4jsf.component.AjaxComponent;
+import org.ajax4jsf.component.AjaxActionComponent;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.event.DataFilterSliderAdapter;
@@ -46,7 +45,7 @@
/**
* JSF component class
*/
-public abstract class UIDataFltrSlider extends UICommand implements
DataFilterSliderSource, AjaxComponent {
+public abstract class UIDataFltrSlider extends AjaxActionComponent implements
DataFilterSliderSource {
/**
* The component type for this component.
@@ -74,26 +73,30 @@
}
public void broadcast(FacesEvent event) throws AbortProcessingException {
- if (event instanceof DataFilterSliderEvent){
-
- FacesContext context = FacesContext.getCurrentInstance();
- AjaxRendererUtils.addRegionByName(context, this, this.getId());
- String forAttr = this.getFor();
- RendererUtils rendUtil = RendererUtils.getInstance();
-
- if(forAttr != null) {
- AjaxRendererUtils.addRegionByName(context, this,
rendUtil.correctForIdReference(forAttr, this));
- }
-
- if(getSliderListeners().length < 1){
- addSliderListener(new DataFilterSliderAdapter(getSliderListener()));
- }
- }
+ if (event instanceof DataFilterSliderEvent) {
- super.broadcast(event);
+ if (getSliderListeners().length < 1) {
+ addSliderListener(new DataFilterSliderAdapter(getSliderListener()));
+ }
+ }
+ super.broadcast(event);
+
}
+ protected void setupReRender(FacesContext context) {
+ super.setupReRender(context);
+ //add data slider itself to rendered list of components
+ AjaxRendererUtils.addRegionByName(context, this, this.getId());
+
+ String forAttr = this.getFor();
+ RendererUtils rendUtil = RendererUtils.getInstance();
+
+ if (forAttr != null) {
+ AjaxRendererUtils.addRegionByName(context, this,
rendUtil.correctForIdReference(forAttr, this));
+ }
+ }
+
public void processDecodes(FacesContext context) {
if (context == null)
throw new NullPointerException();
Modified:
trunk/ui/dataFilterSlider/src/main/java/org/richfaces/renderkit/DataFilterSliderRendererBase.java
===================================================================
---
trunk/ui/dataFilterSlider/src/main/java/org/richfaces/renderkit/DataFilterSliderRendererBase.java 2009-02-11
18:19:42 UTC (rev 12632)
+++
trunk/ui/dataFilterSlider/src/main/java/org/richfaces/renderkit/DataFilterSliderRendererBase.java 2009-02-11
20:30:56 UTC (rev 12633)
@@ -30,6 +30,7 @@
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.convert.ConverterException;
+import javax.faces.event.ActionEvent;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.javascript.JSFunction;
@@ -184,10 +185,10 @@
//ajaxSlider.setHandleValue(ajaxSlider.getStartRange());
} else {
dataFilterSlider.setHandleValue(newSliderVal);
-
- DataFilterSliderEvent event = new DataFilterSliderEvent(dataFilterSlider,
oldSliderVal, newSliderVal);
-// dataFilterSlider.queueEvent(event);
- event.queue();
+
+ new DataFilterSliderEvent(dataFilterSlider, oldSliderVal,
newSliderVal).queue();
+ new ActionEvent(dataFilterSlider).queue();
+
if (dataFilterSlider.isStoreResults()) {
dataFilterSlider.filterDataTable(newSliderVal.intValue());
}