Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-1441

a4j:push: JS error.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate Issue
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.2.0
    • Component/s: None
    • Labels:
      None

      Description

      <a4j:form>
      <a4j:region>
      <a4j:push reRender="msg" eventProducer="#

      {pushBean.addListener}

      " interval="2000"/>
      </a4j:region>
      <a4j:outputPanel id="msg" >
      <h:outputText value="#

      {pushBean.date}

      ">
      <f:convertDateTime type="time"/>
      </h:outputText>
      </a4j:outputPanel>
      <a4j:commandButton value="Push!!" action="#

      {pushBean.push}

      " ajaxSingle="true"/>
      </a4j:form>

      package demo;

      import java.util.Date;
      import java.util.EventListener;
      import java.util.EventObject;
      import org.ajax4jsf.event.PushEventListener;

      /**
      *

      • @author Administrator
        */
        public class PushBean {

      /** Creates a new instance of TheBean */
      public PushBean() {

      }
      private Date date;
      private PushEventListener listener = new MyPushEventListener();

      public void addListener(EventListener listener) {
      synchronized (listener) {
      if (this.listener != listener)

      { this.listener = (PushEventListener) listener; }

      }
      }

      public Date getDate()

      { return new Date(); }

      public void push() {
      synchronized (this.listener)

      { this.listener.onEvent(new EventObject(this)); }

      }

      }
      class MyPushEventListener implements PushEventListener {

      public void onEvent(EventObject evt)

      { System.out.println(evt.getSource()); //DO SOME ACTION IN HERE }

      }

      check that FireBug is disabled. click on the push button. JS error appears.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  afrancuzov Alexander Francuzov
                  Reporter:
                  ilya_shaikovsky Ilya Shaikovsky
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: