Hi,

I use this simple technique:

var ignoreEvent = 0;

function myMethodWithoutEvent() {
    ignoreEvent++;
    try {
       // set current row and other things we don't want to throw the
trigger.
    } finally {
      ignoreEvent--;
    }
}

function mySelectRowEvent(event) {
   if (!ignoreEvent) {
        .....
   }
}



Simon Bull wrote:
> 
> 
> Hi Jim,
> 
> I had a similar problem a while ago -- where a real mouse event would
> trigger a listener, which would then update a widget that threw the same
> event, and get lost in a loop.
> 
> I am not sure if this is the most elegant solution, but I ended up adding
> a piece of state to event objects that are constructed and thrown by
> listeners. The piece of state indicates whether or not the event is a
> result of a raw mouseevent.  
> 
> Listeners can then look for that piece of state in events that they hear,
> and behave appropriately.  I.e., your listeners can distinguish between
> real mouseevents and "second-order" generated events.
> 
> Hope this helps,
> 
> Simon
> 
> 
> Jim Hunter <[EMAIL PROTECTED]> wrote:   I am having a bit of an issue
> with the events of the Table. Specifically, I have 3 tables that have
> cascading dependencies. The data in table 3 depends on the selected row in
> table 2, the data in table 2 depends on the selected row in table 1. I
> first tried to use the 'Click' event to control updates but that event
> does not fire reliably (you have to click and hold or click a second time
> to get it to fire) and when it fires the selected row is not reported
> correctly. I then tried to do it the 'correct' way and use the
> selectionChanged event and it fires 100% of the time, but since I set the
> currently selected row for each table (to visually show the user which row
> in each table is selected) when I create the tables, it fires the
> selectionChanged event on that table which causes a total chain reaction
> that never ends. So, when you have many tables, and you need to accurately
> respond  to users clicks and you need to show the
>  selected rows, how do you do it? There has to be a simple thing that I am
> overlooking but I'm not seeing it.
>   
>  I tried to disable the table, then set the selected row, then enable it
> again but that also fires the selectionChanged event. Is there a way to
> disable events while I am setting the selection, then re-enable them
> without having to use removeEventListener/addEventListener?
>   
>  Thanks,
>  Jim
>   
>   
>   
> 
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 
> 
>               
> ---------------------------------
> On Yahoo!7
>   PS Trixi: Check back weekly for Trixi's new online adventures
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 
> 

-- 
View this message in context: 
http://www.nabble.com/qx.ui.table.Table-events-issues-tf2372972.html#a6616229
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to