Em Terça 18 Abril 2006 07:15, [EMAIL PROTECTED] escreveu: > I think a client-based approach for this issue is a bit better. > > A shuttle/dual-list widget is _functionally_ equivalent with a <select > multiple="multiple"> box. > Of course, a shuttle/dual-list widget is more usable & appropriate for > large lists. > > Instead of having the server generate code for a Javascript-dependent > widget, you can use Javascript (if available) to transform a <select > multiple="multiple"> list box into a fully-fledged shuttle widget. Here > are some selling points: > > * when JS is not available, you still have a functional widget > * no server-side changes; act like it's a normal <select> box > * beautiful :P > > > Here you have a working example: > http://learn.devnet.ro/dual.php
For the option of using a simple select with multiple we already have a widget that can be used right now, so what you got here is the choice of another widget. Both support multiple selections. I also believe that having this shuttle list makes it more intuitive on what will happen and how to interact with it: at least here on Firefox 1.5 and on Konqueror 3.5.2 level "a" on Linux I have to hold the Ctrl key pressed to select multiple entries and the interface doesn't make it intuitive. There in shuttle list, even though you can select multiple options the same way -- holding the Ctrl key --, you are able to select one option at a time in an intuitive fashion. I had this implemented first like you say and users thanked me for making it easier when I had the first version of select shuttle deployed. It is too easy to miss pressing Ctrl and loosing all selected entries... Another thing that I don't know if I should bundle together is the selectbox.js JavaScript library so that it is possible to select all items on the right list automatically (it is just adding an onsubmit event to the submit button). Your suggestion doesn't require this because you'll have the selected items naturally. I haven't implemented a lot of options that I could have -- e.g. limiting the number of items that can be selected, adding some kind of "auditing" with the names of options added / removed from each list, etc. -- to make it simple and useful in the most common case. Adding some of those eliminate the need of the "selectbox.js" I mentioned above but would add a new "unexpected" parameter to your code (I can make it optional at the widget instantiation, though)... I'll think about this approach (the problem is that it will return a hidden field that is a text field, so aditional parsing would have to be done controller-side to make it a list...). With regards to "server-side changes" I didn't get your point. Do you mean changing the template for your forms and installing a new egg? Thanks for your comments! :-) -- Jorge Godoy <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

