Re: lcdui - List vs ChoiceGroup (midp1.0)
- From: "Darryl L. Pierce" <mcpierce@xxxxxxxxx>
- Date: Sat, 12 Nov 2005 13:30:46 -0500
David N. Welton wrote:
Basically - is there any reason to use List for anything other than a 'menu'?
Perhaps I should define 'menu' better - or what I mean by it:
A list of options on the screen that cause some action to be performed when one is selected. This is basically what you get with an 'IMPLICIT' List if you redefine the SELECT_COMMAND to do something interesting.
There are many uses for a List object. It's the LCDUI equivalent of a group of either radio buttons or checkboxes depending on whether your application needs exclusive or multiple options set.
If your application functions by doing something immediately when a List item is selected, then yes, a ChoiceGroup would have looked wrong too.
Having multiply sets of directly related but mutually exclusive selections implies an immediate response.
I'm not clear if we're writing at cross purposes though... did your application work like my description of menu, or were your lists EXCLUSIVE or MULTIPLE and acted on by a Command?
Exclusive. The selections in the second group depend directly on what's selected in the first group.
Perhaps I could rephrase my question in a different way:
In the case where I want to display a series of items that are either
EXCLUSIVE or MULTIPLE, are there any disadvantages to a single ChoiceGroup on a form?
The only advantage to using a ChoiceGroup on a Form is that you can have other Item objects on the screen as well. This can be good if those other items and the ChoiceGroup interact with each other in some way, but it's definitely bad in that it's cluttering up a small display with items that might end up not being visible.
The advantage to the ChoiceGroup is that you can run code immediately on selection of an item. For example: a checklist (so MULTIPLE), where some action happens when you check off the last item in the list.
No, not quite. Have you actually read the API for ItemStateListener? It is not guaranteed to fire at any point in time, let alone when options are toggled in a ChoiceGroup. Be careful in your assumptions.
-- Darryl L. Pierce <mcpierce@xxxxxxxxx> Visit my homepage: <http://mcpierce.multiply.com> "By doubting we come to inquiry, through inquiry truth." - Peter Abelard .
- References:
- lcdui - List vs ChoiceGroup (midp1.0)
- From: David N. Welton
- lcdui - List vs ChoiceGroup (midp1.0)
- Prev by Date: Re: Garbage collection question?
- Next by Date: Re: J2ME
- Previous by thread: Re: lcdui - List vs ChoiceGroup (midp1.0)
- Next by thread: Java Exception Please Help
- Index(es):