Archived:Item.getLabel() Method returns incorrect value on S60 1st Edition (Known Issue)
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.
The article is believed to be still valid for the original topic scope.
The article is believed to be still valid for the original topic scope.
Article Metadata
Compatibility
Platform(s): S60 1st Edition
Article
Created: User:Technical writer 1
(23 Mar 2004)
Last edited: hamishwillee
(28 Jun 2012)
Contents |
Overview
The Item.getLabel() method doesn't seem to return the correct value for a ChoiceGroup's Label.
Symptoms
The Item.getLabel() method may return a null value, which results in NullPointerException.
Description
There is a known issue in setting the label in ChoiceGroup constructor. A ChoiceGroup (direct subclass of Item) is created as follows:
cg = new ChoiceGroup("ChoiceGroup", ChoiceGroup.EXCLUSIVE, stringOptions, null);
and if the label is queried as follows:
System.out.println("Label: "+cg.getLabel());
</code>
The result is "Label: null." However, the "ChoiceGroup" label is properly visible on the screen.
Solution
If the label is set by using the Item.setLabel() method instead of just using the ChoiceGroup constructor, also the Item.getLabel() method returns the correct result.


(no comments yet)