Jorge Godoy ha scritto:
> jose <[EMAIL PROTECTED]> writes:
>
>   
>> Hi,
>>
>> I would like to know if is there any demo how to use SelectShuttle.
>> I can't get it working.
>>
>> I created a form  to assign permissions to groups.
>> In this form I have a SingleSelectField where I can select a group
>> and then SelectShuttle should display in the left side a list of 
>> permissions yet not assigned
>> and in the right side a list of permissions already assigned.
>>
>> I added a submit.form() to onchange event on SingleSelectField ,
>> I expected the SelectShuttle refill itself with the profile of selected 
>> group, but...
>>
>> My controller in on:  http://pastebin.ca/313123
>> Could please someone give me some help?
>>     
>
> Operation example: http://vp.godoy.homeip.net/termos/edit/16236/#editar
> Code on trac (link on the top of the page).
>
>
> This should be better worked, it served its purposes of introducing TG to a
> friend and now I should polish the interface and get it better for heavier
> usage...
>
>
> Be seeing you,
>   
Thank you, for the link. Jorge.
--------------------------------
I compared your SelectShuttle and the mine. I use 2 functions to set 
default and available_options:

set default           = assegn(gruppo) returning a list of permissions 
already assigned for the group 'gruppo' and
set available_options = dispon() returning a list of all available 
permissions.

I see you don't  set the default variable
but only available_options with make_list().

What make_list returns?
Why you don't set default ?
----------------------------------

your widget:

    SelectShuttle(
        label = '',
        title_available = _(u'Permissoes disponiveis'),
        title_selected = _(u'Permissoes selecionadas'),
        btn_all_available = _(u"|< Todos"),
        btn_all_selected = _(u"Todos >|"),
        available_options = model.make_list(
            model.Permission, None,
            'permission_name',
            orderBy = model.Permission.q.permission_name),
        )


my widget:

        SelectShuttle(
            name = 'permessi_options',
            available_options=dispon(),
            default = dict(selected = assegn(gruppo) ),
            title_selected = 'Permessi assegnati',
            title_available = 'Permessi non assegnati',
            label=''
            ),


jo


--~--~---------~--~----~------------~-------~--~----~
 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to