4 Replies Latest reply on Nov 2, 2010 10:35 AM by ibookjim

    Keyhandling in the datalist

    ibookjim

      Hi I´ve noticed that I can pick my choice with the arrow keys in the datalist by default. How do I exclude that keyhandler in Catalyst? I can't read anything about this feature in the documentation or in your tutorials. Neither i can't find the code in Flash Builder 4.

       

      I just want to shut it down in all my states in just this application.

        • 1. Re: Keyhandling in the datalist
          SrinivasAnnam Adobe Employee

          Hi,

           

             I'm not sure why you would you want to disable selection through keyboard on a list. This might affect the usability of the application.

           

             Anyways, This is very rare usecase and not many users will be doing this. That is the reason why there is no straight forward method to do this Flash Catalyst or Flash Builder.

           

             Doing this is in Flash Builder very simple. We just need to create a new ActionScript component extending the default List component and override the Key listener. I have attached a custom component to this thread, you can use the same in your project.

           

            Copy "MyList.as" file to your project source folder in Flash Builder. Add a namespace to the main application like this xmlns:local="*" and Replace "s:List" with "local:MyList"

           

            Please refer to sample attached and let us know if you are able to get it working.

           

          Regards

          Srinivas Annam

          1 person found this helpful
          • 2. Re: Keyhandling in the datalist
            Peter Flynn (Adobe) Adobe Employee

            If you just want to block all keyboard interaction with the List, a simpler way to do this in Flash Builder is:

             

            1. Import the Catalyst project
            2. Find the <s:List> tag representing your Data List
            3. Add the attribute focusEnabled="false" to the XML tag

             

            - Peter

            1 person found this helpful
            • 3. Re: Keyhandling in the datalist
              ibookjim Level 1

              Thanks SrinivasAnnam,

               

              I will try out your code asap. It´s great that I can override the defaults i Catalyst if I want to exclude classes for just any RIA.

               

              Just an explanation; I like the way datalist works in FC so  I use it very often. Its easy further on to dataconnect that list to a other source in FB4.

               

              And is this RIA I created a custom component with some stages. At the first stage I have a datalist holding links to the other stages in the same component. By doing this I only need to make 1 transition for all the components in my custom component. Like nestling movieclips in flash.

               

              But that listener in that datalist can toggle the stages within that component. So that's why I needed to turn that of.

               

              Thanks again

              • 4. Re: Keyhandling in the datalist
                ibookjim Level 1

                Thansk Peter,

                 

                hehe this is the FLEX-way. It's great. Just one attribute and its done on that component. So we got two solutions on this - one global and one specific.

                 

                Thanks for the help.