Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

events coming back to source

Thread view: 
Tomba - 26 Dec 2005 15:10 GMT
Hi,

I have here a panel on which 3 controls are displayed. All of them show
some information of the same data object "Data". Every of the three
controls listens to changes in the Data object.

Now however, when the user clicks something in eg. control2, that
control for instance performs data.update(). Data then fires events,
which is ok except for control2 who doesn't need to be notified of
course as control2 itself was the cause of the event.

Now my question: how can I prevent control2 from acting on the event?
(in my example it may also be control1 or control3 of course).

Thanks a lot,
happy holidays

Steven De Groote
Chris Smith - 28 Dec 2005 07:40 GMT
> Now however, when the user clicks something in eg. control2, that
> control for instance performs data.update(). Data then fires events,
[quoted text clipped - 3 lines]
> Now my question: how can I prevent control2 from acting on the event?
> (in my example it may also be control1 or control3 of course).

Declare a boolean flag in control2.  Set it to false.  When you're
firing an event, set it to true just around the call that fires the
event, then set it false again right after.  In the event handler, check
the flag, and return immediately when it's true.

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.