[richfaces-svn-commits] JBoss Rich Faces SVN: r18938 - in trunk/ui/core/ui/src/main/java/org: richfaces/renderkit/html and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Aug 23 13:12:18 EDT 2010


Author: nbelaevski
Date: 2010-08-23 13:12:17 -0400 (Mon, 23 Aug 2010)
New Revision: 18938

Removed:
   trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/AbstractPoll.java
Modified:
   trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/html/AjaxPollRenderer.java
Log:
https://jira.jboss.org/browse/RF-9054
Removed AbstractPoll legacy class

Deleted: trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/AbstractPoll.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/AbstractPoll.java	2010-08-23 16:55:52 UTC (rev 18937)
+++ trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/AbstractPoll.java	2010-08-23 17:12:17 UTC (rev 18938)
@@ -1,67 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- */
-
-
-
-package org.ajax4jsf.component;
-
-import org.richfaces.component.AbstractActionComponent;
-
-/**
- * Component for periodically call AJAX events on server ( poll actions )
- * @author shura
- *
- */
-//@JsfComponent
-public abstract class AbstractPoll extends AbstractActionComponent {
-    public static final String COMPONENT_TYPE = "org.ajax4jsf.Poll";
-
-    private transient boolean submitted = false;
-
-    /**
-     * @return the submitted
-     */
-    public boolean isSubmitted() {
-        return submitted;
-    }
-
-    /**
-     * @param submitted the submitted to set
-     */
-    public void setSubmitted(boolean submitted) {
-        this.submitted = submitted;
-    }
-
-    /**
-     * @return time in mc for polling interval.
-     */
-    public abstract int getInterval();
-
-    /**
-     * @param interval time in mc for polling interval.
-     */
-    public abstract void setInterval(int interval);
-
-    public abstract boolean isEnabled();
-
-    public abstract void setEnabled(boolean enable);
-
-}

Modified: trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/html/AjaxPollRenderer.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/html/AjaxPollRenderer.java	2010-08-23 16:55:52 UTC (rev 18937)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/renderkit/html/AjaxPollRenderer.java	2010-08-23 17:12:17 UTC (rev 18938)
@@ -29,6 +29,7 @@
 import javax.faces.application.ResourceDependency;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
+import javax.faces.context.PartialViewContext;
 import javax.faces.context.ResponseWriter;
 import javax.faces.event.ActionEvent;
 
@@ -56,12 +57,18 @@
     public static final String RENDERER_TYPE = "org.richfaces.PollRenderer";
     private static final String AJAX_POLL_FUNCTION = "RichFaces.startPoll";
 
+    private void addComponentToAjaxRender(FacesContext context, UIComponent component) {
+        PartialViewContext pvc = context.getPartialViewContext();
+        pvc.getRenderIds().add(component.getClientId(context));
+    }
+    
     @Override
     protected void queueComponentEventForBehaviorEvent(FacesContext context, UIComponent component, String eventName) {
         super.queueComponentEventForBehaviorEvent(context, component, eventName);
         
         if (AbstractPoll.TIMER.equals(eventName)) {
             new ActionEvent(component).queue();
+            addComponentToAjaxRender(context, component);
         } 
     }
 
@@ -133,6 +140,7 @@
             Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();
             if (requestParameterMap.get(poll.getClientId(context)) != null) {
                 new ActionEvent(poll).queue();
+                addComponentToAjaxRender(context, component);
             }
         }
     }



More information about the richfaces-svn-commits mailing list