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

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



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


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!");
displayNote("Inline mode!");
} catch (Exception ex) {
// java.lang.IllegalArgumentException: NOT_SUPPORTED caught when calling LCDUIUtil.getObjectTrait()


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.
74 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.