• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

on multiple events ...

 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a series of cascading selects, now shown listbox fashion with several rows visible instead of dropdown style. Using onclick events I'm happily clicking up and down my hierarchy with the mouse.

I'd also like to support keyboard navigation, so I hooked up onchange to the very same event handlers. That works fine for keyboard but when I mouse click a change both events fire and all my AJAX stuff runs twice.

I can't take out onlick and rely on onchange because ... take a deep breath ... as you click on any part of the hierarchy two things happen: the next listbox fills with child nodes AND the bottom half of the page shows the object at that level. Sometimes I click in box1, box2, box3, and box4 and view the lowest level leaf. Then I click back on the current row in box2 and want to see the object at that level again. onclick does it perfectly but onchange doesn't fire.

Any thoughts on supporting both without running twice?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should only need onchange, was there a reason why you need onclick?

Eric
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Clicking a box to the left of the most recently clicked, even clicking the currently selected row, causes the bottom half of the page to change. And causes the boxes to the right to deselect.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wouldn't the current row that is highlighted already have the data loaded for it?

If some reason that is not the case, add a filler row to force the user to seelct it.

If you want to go this route of two event handlers, you would have to do something to say, hey I am processing already.

Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic