I guess I would call this a hack.  It assumes that the queued up events
happen within 200ms of each other:

 

        <fd:on-value-changed>

          <fd:javascript>

            var lastCall = cocoon.session.getAttribute("lastCall");

            var thisCall = Packages.java.lang.System.currentTimeMillis();

            if (null == lastCall || thisCall - lastCall > 200) {

              var changeListener =
Packages.com.my.app.form.event.MyChangeListener;

              changeListener.valueChangedStatic(event);

            }

            cocoon.session.setAttribute("lastCall", thisCall);

          </fd:javascript>

        </fd:on-value-changed>

 

Maybe there is a method to empty the event queue?

 

gary

 

  _____  

From: Gary Larsen [mailto:[email protected]] 
Sent: Monday, February 09, 2009 10:36 AM
To: [email protected]
Subject: CForms - disable on-value-changed while inside ValueChangedListener

 

Hi,

 

I need to avoid triggering additional value-changed events while processing
inside of a ValueChangedListener.  Since I'm setting values of other widgets
on the form in the listener, those events are causing a cascade effect.

 

While in the ValueChangedListener, is there a way to keep from triggering
other events?

 

Thanks for any suggestions!

gary

Reply via email to