ListItems.ValueSelector doesn't work well with dynamic options

Bug #1201872 reported by Ken VanDine
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Won't Fix
Undecided
Unassigned

Bug Description

It would be nice if the ValueSelector could be backed by a model that could work as a map of sorts. This would be useful for dynamically creating a list of options and properly dealing with the selected choice. For example, you might want to display a user friendly and translated string for a setting in the option, but when selected store a value that is meaningful to the application that is going to use it. Like "Mention Only" could then be mapped to "mentions-only" without needing to do a big switch statement. Or listing files in a directory for choosing a sound for an event.

Revision history for this message
Sebastien Bacher (seb128) wrote :

I just hit that problem working on the system-settings' sound panel.

The code there lists the soundfiles in a directory to display them on screen, we do want to make the name a bit better but still write the actually filename to the configuration

e.g "incoming-message.ogg" should be displayed as "Incoming message" in the list, but selecting it should set the configuration key to "incoming-message.ogg"

Revision history for this message
Tim Peeters (tpeeters) wrote :

should this appear in a valueselector, or in a new page that lists the options?

Revision history for this message
Sebastien Bacher (seb128) wrote :
John Lea (johnlea)
no longer affects: ubuntu-ux
Revision history for this message
Tim Peeters (tpeeters) wrote :

We have a new OptionSelector component now that will replace the ValueSelector.

Changed in ubuntu-ui-toolkit:
status: New → Won't Fix
Revision history for this message
Sebastien Bacher (seb128) wrote :

You are sure that bug doesn't apply to the OptionSelector as well?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.