cancel
Showing results for 
Search instead for 
Did you mean: 

Context Exception

Former Member
0 Kudos

Hi

I am Trying to ad values to "DropDownByKey" UI element dynamically.I created a Context Node "Temp" under which i created a attribute "ShiftTemp".Now to add value dynamically i had written following code in View Controller.

-


IWDAttributeInfo attinfo = wdContext.nodeTemp().getNodeInfo().getAttribute("ShiftTemp") ;

ISimpleTypeModifiable modinfo = attinfo.getModifiableSimpleType();

IModifiableSimpleValueSet valset = modinfo.getSVServices().getModifiableSimpleValueSet();

-


It is giving me "Context Exception :cannot modify attribute "ShiftTemp" datatype".

can anybody tell me what was the problem?

Thanks

Prasad

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Lohitha

Thanks for reply.I am giving points for your relevent answer

Thanks

Prasad

Answers (2)

Answers (2)

former_member197348
Active Contributor
0 Kudos

Hi,

ISimpleTypeModifiable modinfo = attinfo.getModifiableSimpleType();

change this to

<b> ISimpleTypeModifiable modinfo = (ISimpleTypeModifiable) attinfo.getModifiableSimpleType();</b>

regards,

Siva

Former Member
0 Kudos

hi,

you can check out this example

https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/391ee590-0201-0010-1c89-f1193a886421

<b>Sample Code</b>

IWDAttributeInfo attibuteInfo = wdContext.getNodeInfo().getAttribute(“country”);

ISimpleTypeModifiable countryType = attibuteInfo .getModifiableSimpleType();

countryType.setFieldLabel(“Country”);

IModifiableSimpleValueSet valueSet = automakerType.getSVServices().getModificableSimpleValueSet();

valueSet.put(“Germany”);

Regards,

Gopi