LCDUIUtil.getObjectTrait() with nokia.ui.s40.item.substate raises NOT SUPPORTED exception
Article Metadata
Tested with
Compatibility
Article
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.


Fixed on software version 06.00
This issue has been tested on the latest software version 06.00 for X3-02 and the problem is now fixed.Nokia Development Technical Support
skalogir 17:02, 23 August 2011 (EEST)