0

Disable/Enable an Event

asked 2009-05-07 17:13:11 +0800

fusion35 gravatar image fusion35
237 2 5

updated 2009-05-22 04:08:21 +0800

Hi :

I want to disable/enable an event (onChanging in this case). I am implementing a search where I want the user to give an option to search either as he types in a text box or after he types and click a button. If user chooses the later I want that the onChanging should not fire otherwise it should.

How can I get that ?

regards

Devinder

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2009-05-07 17:17:38 +0800

james gravatar image james
255 2

updated 2009-05-07 17:17:59 +0800

You could store the onChanging event in a function and use zscript to change the textbox's onChanging value to be null, or to be the function.
Also you could do implement an if statement in the onChanging event (if the latter is chosen the function won't fire, if it's not chosen then the funciton will fire)

Not sure if these are the best solutions, but they should work

link publish delete flag offensive edit

answered 2009-05-07 17:23:17 +0800

fusion35 gravatar image fusion35
237 2 5
Thanks for the reply James. Right now I am using if in the onChanging event, but was thinking If I could disable/enable the event based on the users choice. regards Devinder
link publish delete flag offensive edit

answered 2009-05-19 07:30:05 +0800

PeterKuo gravatar image PeterKuo
481 2

http://www.zkoss.org/javadoc/3.6.1/zk/org/zkoss/zk/ui/event/class-use/EventListener.html

Component.removeEventListener(java.lang.String evtnm, EventListener listener)
Removes an event listener.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-05-07 17:13:11 +0800

Seen: 200 times

Last updated: May 19 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More