[ 
https://issues.jboss.org/browse/RF-12096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brian Leathem updated RF-12096:
-------------------------------

    Fix Version/s: 4.3-Tracking

    
> Push: there is delay between repeated subscribtion
> --------------------------------------------------
>
>                 Key: RF-12096
>                 URL: https://issues.jboss.org/browse/RF-12096
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-push/poll
>    Affects Versions: 4.2.0.Final
>            Reporter: Lukáš Fryč
>             Fix For: 4.3-Tracking
>
>
> When you have conditionally rendered {{a4j:push}} component and you disable 
> it,
> then it stops to receive push events.
> Once you enable it, there is delay before it will start to receive events 
> again.
> Sample code for reproduction:
> {code:xml}
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml"; 
> xmlns:ui="http://java.sun.com/jsf/facelets"; 
> xmlns:h="http://java.sun.com/jsf/html";
>     xmlns:f="http://java.sun.com/jsf/core"; 
> xmlns:a4j="http://richfaces.org/a4j";>
> <f:view>
>     <h:head>
>     </h:head>
>     <h:body>
>         <h:form>
>             <br /><br /><br /><br />
>             <!--  PUSH 1 -->
>             <a4j:commandButton value="Push 1!" action="#{richBean.push}" />
>             
>             
>             <a4j:outputPanel id="pushPanel">
>                 <a4j:push id="push" rendered="#{not pushDisabled}" 
> address="sampleAddress"  
> ondataavailable="$('*[id$=outputDate]').text(event.rf.data)" 
> onsubscribed="alert('subscribed')" />
>             </a4j:outputPanel>
>             
>             
>             
>             <a4j:outputPanel id="pushDisablementPanel">
>                 <h:selectBooleanCheckbox value="#{pushDisabled}">
>                     <a4j:ajax render="pushPanel pushDisablementPanel" />
>                 </h:selectBooleanCheckbox>
>                 <h:outputText value="#{pushDisabled ? 'disabled' : 
> 'enabled'}" />
>             </a4j:outputPanel>
>             
>             <br />
>             
>             <a4j:outputPanel id="outputDate">
>                 #{richBean.date}
>             </a4j:outputPanel>
>             
>             <br />
>         </h:form>
>     </h:body>
> </f:view>
> </html>
> {code}
> {code:java}
> package demo;
> import java.util.Date;
> import javax.faces.bean.ManagedBean;
> import org.richfaces.application.push.MessageException;
> import org.richfaces.application.push.TopicKey;
> import org.richfaces.application.push.TopicsContext;
> @ManagedBean
> public class RichBean {
>     public Date getDate() {
>         return new Date();
>     }
>     public void push() throws MessageException {
>         TopicKey topicKey = new TopicKey("sampleAddress");
>         TopicsContext topicsContext = TopicsContext.lookup();
>         topicsContext.publish(topicKey, new Date().toString());
>         System.out.println("push event");
>     }
> }
> {code}
> Steps to reproduce:
> 1. open the sample page (the "subscribed" message appears)
> 2. click on Push! button (the date is changed)
> 3. check the checkbox
> 4. click on Push! button (the date is not changed anymore)
> 5. uncheck the checkbox (the "subscribed" message appears again)
> 6. click on Push!
> EXPECTED: the date should be changed
> ACTUAL: the date is not changed
> If you will wait for some seconds, the Push! button will cause change of the 
> date,
> but in this delay, client can lose data updates (since "subscribed" event 
> does not show that the client is starting to receive data).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to