Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Revision as of 06:02, 9 August 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LCDUIUtil.getObjectTrait() with nokia.ui.s40.item.substate raises NOT SUPPORTED exception

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): X3-02, C3-01
CompatibilityArticle
Created: Grandlu (13 Oct 2010)
Last edited: hamishwillee (09 Aug 2013)

Contents

Overview

Using LCDUIUtil.getObjectTrait() with the nokia.ui.s40.item.substate trait on a normally compatible item (DateField, Gauge, TextField) will automatically raise a NOT_SUPPORTED exception

Description

If you try to call LCDUIUtil.getObjectTrait(Object item, String trait) with the trait parameter nokia.ui.s40.item.substate and a compatible item parameter (DateField, Gauge, TextField) on X3-02, a NOT_SUPPORTED Exception get raised: java.lang.IllegalArgumentException: NOT_SUPPORTED

This exception should only be raised if the specified trait is not supported by the platform, however Series 40 6th Edition Feature Pack 1 supports the "nokia.ui.s40.item.substate" trait.

How to reproduce

...
TextField myTextField = new TextField("TextFieldTitle", "", 5, TextField.ANY);
...
try {
Object traitValue = LCDUIUtil.getObjectTrait(myTextField, "nokia.ui.s40.item.substate");
 
// Extract the boolean value from the returned Object:
boolean popupUsed = ((Boolean) traitValue).booleanValue();
// if true, a pop-up window is used
if (popupUsed)
displayNote("Pop-up mode!");
else
displayNote("Inline mode!");
} catch (Exception ex) {
// java.lang.IllegalArgumentException: NOT_SUPPORTED caught when calling LCDUIUtil.getObjectTrait()
...
}


Solution

This issue has been fixed and will be part of a newer platform software version soon for both X3-02 and C3-01.

This page was last modified on 9 August 2013, at 06:02.
117 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×