Best implementation for a "selection list dialog"?

72 views
Skip to first unread message

timo.v...@gmail.com

unread,
Dec 15, 2013, 11:46:06 AM12/15/13
to codenameone...@googlegroups.com
I want the user to pick one item from a list of alternatives in a pop-up dialog.

What is the best implementation to achieve this?
  • A Dialog with a List? (Which native style should the selected line be?)
  • A Dialog with a scrollable Container holding a group of CheckBox controls? (How do I encode the values each item represents?)
  • Yet another aproach? 
Thank you for your suggestions.

timo.v...@gmail.com

unread,
Dec 15, 2013, 1:08:01 PM12/15/13
to codenameone...@googlegroups.com, timo.v...@gmail.com
Another suggestion is:
  • A dialog with a GenericSpinner. (But the selection then needs to be text-only)

Shai Almog

unread,
Dec 15, 2013, 2:30:45 PM12/15/13
to codenameone...@googlegroups.com, timo.v...@gmail.com
I would always go with the container/components approach. Simpler, flexible etc.
You can put the values as client properties to the individual components and extract that in the action event.

timo.v...@gmail.com

unread,
Dec 15, 2013, 2:43:10 PM12/15/13
to codenameone...@googlegroups.com, timo.v...@gmail.com
I prefer the GenericSpinner over the Container/RadioButtons solution because all it needs to handle the selection is a DefaultListModel with Objects with a toString() method.

Shai Almog

unread,
Dec 16, 2013, 1:14:04 AM12/16/13
to codenameone...@googlegroups.com, timo.v...@gmail.com
Generic Spinner won't look good on iOS 7 since its really difficult to replicate the behavior of the native spinner.
We will add its functionality to the Picker class after the release which will use the native UI on iOS.
Reply all
Reply to author
Forward
0 new messages