6 Replies Latest reply on May 12, 2010 6:17 PM by karlkras

    a4j events for selectOneMenu?

    karlkras

      Hey,

      Another pretty basic question with hopefully a basic answer.

      I'm running through a UI and noticed that a4j support onchange events on a selectOneMenu component will occur when accessing the list via mouse and changing the selection in this manner, but not if using the keyboard via up and down arrow keys. What event(s) should be used to trigger this?

       

      thanks,

      Karl

        • 1. Re: a4j events for selectOneMenu?
          karlkras

          So let me put this another way...

          Is there a reference somewhere that details the events for all controls and a description on what they're intended to handle? Having this would avoid me asking equally mundane questions in the future.

           

          thanks,

          Karl

          • 2. Re: a4j events for selectOneMenu?
            nbelaevski

            Hi Karl,

             

            This information is available in components' documentation, check TLD files.

            1 of 1 people found this helpful
            • 3. Re: a4j events for selectOneMenu?
              karlkras

              Hmmm, well this would seem to be a jsf selectOneMenu issue? I find no message capable of performing this properly. Certainly this has to be possible.

              • 4. Re: a4j events for selectOneMenu?
                nbelaevski

                Karl,

                 

                There should be onkeyup/onkeydown events, aren't they there?

                • 5. Re: a4j events for selectOneMenu?
                  karlkras

                  My testing finds that they have no affect. Besides, (after considering what I was testing) I'm not after the keyup/down events anyway, I want the "arrow up and arrow down selected" events if I were to do this logically.which obviously isn't an option... it would seem that it should be built into the onchange event since it's clear that the control is reacting to it.

                   

                  thanks.

                  • 6. Re: a4j events for selectOneMenu?
                    karlkras

                    Hey Nick,

                    Wow, that was a real long winded explanation I gave in why it wouldn't fit my needs, when in fact it did.

                    For some reason my original test harness was giving false negatives and I could't see the effects of using both onchange and onkeyup.

                    Now not only can I reRender based on the arrow key change events, but also in the case that an item in the list was selected via an alpha selection from the keyboard. Pretty much exactly what I was after.

                     

                    thanks,

                    Karl