7 Replies Latest reply on Nov 30, 2006 6:48 AM by DaniOrama9

    Upgrading List Component

      Hi folks, I'm trying to create a multiple selection list component but with a bit different behaviour, but I'm getting some trouble trying to do some things:

      -Multiples selection without Shift and Control keys (disable them), just click unselected items to select them and vice versa.
      -Make some items selectable or not according to variables or other things in the form, but letting all the items visible.
      -Changing a bit the movement of the content adding some easing as people use scrollbar.

      Any help is welcome. Who knows, maybe the list component is not the best way to accomplish this things. Any ideas?

      Thanks a lot!
        • 1. Re: Upgrading List Component
          ntsiii Level 3
          Ahh, I am way out of my element here, but I think you will be able to do this, and I think List would be the control to extend.

          Do some more searching the net, look at the source code for List, and investigate the documentation.

          Wish I could be more direct help.

          • 2. Re: Upgrading List Component
            DaniOrama9 Level 1
            I will continue looking.

            Thanks anyway ;D
            • 3. Re: Upgrading List Component
              peterent Level 2
              I would suggest not using List for this. For a couple of reasons: your selection mechanism is non-standard and getting List to do this, while not impossible, would be awkward; you want smooth scrolling - the List scrolls an record at a time. To change the scrolling, well, you might was well write a new component.

              That said - how many records do you anticipate? Less than 100? If so, then I would consider using a VBox within a Canvas and creating the children in a loop (use commitProperties override to do this, especially if it is possible to change the dataProvider on the fly). The Canvas will put on ScrollBars as the VBox grows the scrolling will be smoother. You can even intercept the scroll events and use a MoveEffect if you really must.

              If you think you will have more than 100, but less than say 1000, I'd still try the VBox method and see how will it performs. If not, you'll need a List-like mechanism that uses itemRenderer technology. That opens up a number of cans of worms and perhaps it might be worth looking at the source to List and see what you can gleen from that.
              • 4. Re: Upgrading List Component
                peterent Level 2

                ** duplicate message **
                • 5. Re: Upgrading List Component
                  DaniOrama9 Level 1
                  Thanks peterent, I would try that, but then another question is my head... what if I want to do the same with a Datagrid, it would be really complicated... anyway neither would have more than 100 items, at least not yet, later maximum would be 300 or something like that...

                  The problem is that I want to use the List (and also DataGrids) to select some items, but the Ctrl and Shift keys for selecting are not so "known" for some users, also I find myself really irritating when we forget to press Ctrl and then all the previous selections are gone (damn it, so many times...)

                  I've thinking about changing a bit the interface, so selecting a List element would only open a window where the element is described. Later I will use a button if I want the element added in another list of selected items. I think making the "adding button" enabled or disabled would be far more easy. On the other hand I don't know if it would be possible to make some items on the list (and datagrid) render in a different color if they have been selected already.

                  Anyway, the easing effect would be only to meld the list with the whole design, and not to be so "static", it is not a must ;D

                  Thank you for your help, I will try those ideas!
                  • 6. Re: Upgrading List Component
                    peterent Level 2
                    It would be much more complex to re-write a DataGrid using what I described. However, you could place a DataGrid into a Canvas such that the DataGrid is as large as the number of records*rowHeight. This way the DataGrid isn't scrolling, the Canvas is. This technique would apply to the List, too.

                    As for selection, Ctrl and Shift have been used for multiple selection in Windows and on the Mac for years (Cmd+Click, Option+Click, etc.). If you haven't been using a computer for too long then I could understand that it would not come naturally.

                    If you have an application that uses a selection mechanism that's different from other applications you run the risk of confusing the end-user who may be using other applications. For example, if you have a DataGrid in your application and apply your click scenario and the user then goes to use Excel, they'd have to use a different selection technique - and then either be frustrated with your app, with Excel or with computers in general and just give up.

                    Also, with your scenario how does one clear a selection? Suppose you have clicked 10 items and decide that you want to start over? You have to re-click all 10?

                    Just something to think about.

                    The other thing it looks like you will need are itemRenderers. This will give you total control over colors. Both the DataGrid and List have text-selected-color, roll-over-color, etc styles, but you may want more than that.
                    • 7. Re: Upgrading List Component
                      DaniOrama9 Level 1
                      Hi Peterent, for me the Ctrl and Shift keys are pretty common for selecting... I have been with computers since I was a child, I'm also a Computer engineer and my end of career was made with Flash MX and it was a pretty complex thing, I rebuild many components (I also create a reallt cool editable tree component with effects and undo-redo abilities, create scripts for modify data using my own database model, and some charting and create printable pages...) I spent 2 years making this project for my university, and I even got a price! I'm just starting with actionscript 3 and this "mxml" and I'm getting a bit confused sometimes...

                      All that is just to explain that many things that for us is ver easy for other is not so... My girlfriend use internet a lot, but when I just say her those thing about using keys she get confussed very easy, as my grandfather and parents.

                      Also I think I explained here my application very badly. This application is meant to be a "abilities selector" for a role play event. I create an Accordion with the different sections of character creation, in those section for abilities I just used a TabNavigator for dividing each group, which contents a DataGrid where the people could assign the abilities acoording to the points available. Using keys is going to made that pretty complicate! Maybe I just should use a condition to refresh the abilities available and not selected before. Clear the selection and modifying it are just the reasons why I think using keys and just one view for selected and available items is not going to work.

                      Actually users need to see the evolution of the creation, and man, I'm having really big problems with space... Maybe a system like the one in "WoW" would be easier to the user, but I think that would be pretty damn complicated.

                      I will look for the item renderers once more, after two years without touching Flash I think I'm trying some too difficult... We'll see!

                      Thanks peterent, I'll think about these things and maybe find a better solution.

                      PS: if you know something about viewstacks please post any ideas in my topic asking for that. Thanks ;D