[jifty-devel] Multiple-choice with checkbox

Ruslan Zakirov ruslan.zakirov at gmail.com
Fri Sep 4 11:15:54 EDT 2009


Hello Stanislav,

You can just use multiple argument in ::Radio and render them as
checkboxes :) It's wierd but will be consistent with Select.

Radio and multiple => 1 is confusing and instead of resolving
confusion it's better to create:

::Form::Choice with the following properties: look => {Dropdown,
List}, multiple => {0, 1}, alternative => {0, 1}.

This widget can delegate to particular implementation depending on properties:

Dropdown => Select
Dropdown, alternative => Combobox
List => Radios
List, multiple => Checkboxes
...

As you can see it requires more work, but you can implement only what
you need and live some combinations not implemented. For example
radios with alternative may look like this:

[x] default
[ ] some value
[ ] ____ text input for another value ____

"look", "Dropdown", "List" and other new terms are discussable.

PS: May be ::Checkbox is good choice instead of ::Radio with multiple
property, delegator can just pick correct class depending on props.

On Fri, Sep 4, 2009 at 6:40 PM, Stanislav Sinyagin<ssinyagin at yahoo.com> wrote:
> hi,
>
> there seems to be the only option to have a multiple-choice list by using a
> render_as => 'Select',
> multiple => 1,
>
>
> which is not very convenient for lists longer than 10 items.
>
> It would be cool to have same thing as is done for Radio, but using checkboxes instead.
>
> It's basically a clone of Jifty::Web::Form::Field::Radio with some minor modifications.
> I can try submitting a patch, let's just invent a good name for it.
>
> CheckboxMulti or MultipleChoice or MultiCheckbox ?
>
>
>
> regards,
> stan
>
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>



-- 
Best regards, Ruslan.


More information about the jifty-devel mailing list