Page MenuHomePhabricator

A new input type for an enumeration with multiple values allowed
Closed, ResolvedPublic

Description

Author: trueskew

Description:
In your (Yaron's) words:

"A new input type for an enumeration with multiple values allowed -
instead of a listbox or checkboxes, have each additional value be
selectable using a separate dropdown, with the ability to add or
remove dropdowns using buttons."

Synopsis:

On a form, a declaration that might be similar to

Contributors:
{{field|Names|input type=combobox|multiple|add_button_text="Add another name"}}

would result in a form showing

Contributors:
[Add another name] <= button

Action: hit the [Add another name] button and select Rick Jones

Contributors:
Rick Jones [Remove]
[Add another name]

Action: hit the [Add another name] button and select Bruce Banner

Contributors:
Rick Jones [Remove]
Bruce Banner [Remove]
[Add another name]

Today, this can be done with SIO, a separate template, and the multiple keyword when used on a Form:page. However, that reduces the flexibility of the form layout since the separate template needs to be outside of the "main" template on the form. There are a few other advantages / disadvantages that I can bring up in comments if necessary, so I can keep this as short as possible.


Version: unspecified
Severity: enhancement

Details

Reference
bz25914

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:19 PM
bzimport set Reference to bz25914.

trueskew wrote:

*** Bug 25913 has been marked as a duplicate of this bug. ***

trueskew wrote:

I forgot, I've got a better visual than the text-based one above. It uses SIO, I'd like to see it included as a field type.

http://scratchpad.referata.com/w/index.php?title=Patio&action=formedit

Hi skew,

Sorry for the somewhat belated reply. :)

I've been thinking of adding an input type to SF that resembles the interface that Gmail provides for selecting email addresses. It would probably use the Select2 library; you can see it in action here:

http://ivaynberg.github.io/select2/#drag_drop

Do you think this would be a reasonable substitute for what you're asking about? Or would you still prefer something that looked like the multiple-instance template interface?

I don't have a Semantic Forms wiki to test if the select2 implementation being in use already allows multiple values. Maybe it's a dupe of T63974: Change Semantic Forms autocompletion to use the Select2 library

Ciencia_Al_Poder - yes, such a thing has been available in Semantic Forms (as the "tokens" input type) since version 2.8 in September 2014. I'm marking this bug as fixed.

Yaron_Koren set Security to None.