cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByKey

Former Member
0 Kudos

Code for DropDownByIndex----


IWDAttributeInfo attrInfo = wdContext.nodeColor().getNodeInfo().getAttribute(IPrivateFirst_CompView.IColorElement.VALUESET);

ISimpleTypeModifiable msType = attrInfo.getModifiableSimpleType();

IModifiableSimpleValueSet valueSet = msType.getSVServices().getModifiableSimpleValueSet();

valueSet .put("","choose");

valueSet .put("1","black");

valueSet .put("2","red");

valueSet .put("3","blue");

Getting Runtime error in the line----


ISimpleTypeModifiable msType = attrInfo.getModifiableSimpleType();

I am unable to set different colors as DropDownList dybamically.

Please help me out.

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member185086
Active Contributor
0 Kudos

Hi

You can simply perform these operation by using DropDownByKey and by design time given the enumeration value .

Best Regards

Satish Kumar

Former Member
0 Kudos

hI ANINDITA,

you create Color node in controller context and mappepped into view context through open navigator modeler..

cardinality of color node id--1:1.

then valueset attribute binding into dropdownkey UI element as you did befi0re

this piece of code must be written component controler

you create one method and put below code on thet method...as dropKey

this method call from view

InVIEW

public wdDoinit(){

wdGet<your component contlloer name>.dropKey();

}

IN controller

public void dropKEY(){

IWDAttributeInfo attrInfo = wdContext.nodeColor().getNodeInfo().getAttribute(IPrivateFirst_CompView.IColorElement.VALUESET);

ISimpleTypeModifiable msType = attrInfo.getModifiableSimpleType();

IModifiableSimpleValueSet valueSet = msType.getSVServices().getModifiableSimpleValueSet();

valueSet .put("","choose");

valueSet .put("1","black");

valueSet .put("2","red");

now it works fine now

thanks

jati

valueSet .put("3","blue");

}

thanks

sudhira

Edited by: sudhir kumar on Mar 24, 2009 5:26 AM

Former Member
0 Kudos

I would propose to not repost the same question but reading the answers to the original question first.

Armin

Former Member
0 Kudos

>

> Code for DropDownByIndex----


>

> IWDAttributeInfo attrInfo = wdContext.nodeColor().getNodeInfo().getAttribute(IPrivateFirst_CompView.IColorElement.VALUESET);

> ISimpleTypeModifiable msType = attrInfo.getModifiableSimpleType();

> IModifiableSimpleValueSet valueSet = msType.getSVServices().getModifiableSimpleValueSet();

> valueSet .put("","choose");

> valueSet .put("1","black");

> valueSet .put("2","red");

> valueSet .put("3","blue");

>

> Getting Runtime error in the line----


>

> ISimpleTypeModifiable msType = attrInfo.getModifiableSimpleType();

>

> I am unable to set different colors as DropDownList dybamically.

>

> Please help me out.

Hi,

I guess you are confused between Key and Index

Please have a look at this document

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-tec...

Regards

Ayyapparaj