cancel
Showing results for 
Search instead for 
Did you mean: 

How to set values in DropDownByKey dynamicaly

Former Member
0 Kudos

Hi,

How to set values in DropDownByKey dynamicaly using web dynpro java

Thanks.

Edited by: venkat99 on May 19, 2010 5:26 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Venkat,

Create a context node and one attribute inside the node for drop down. Then bind this context with DropDownBY Key.

Now populate the attribute in your code :

//Read attirbute info:-

IWDAttributeInfo att=wdContext.getNodeInfo().getAttribute(IPrivate<ViewName>View.IContextElement.DDValue);

//Define type

ISimpleTypeModifiable ss=att.getModifiableSimpleType();

//define value set

IModifiableSimpleValueSet ValueSet=ss.getSVServices().getModifiableSimpleValueSet();

Or use single line code for above three line

final IModifiableSimpleValueSet ValueSet= wdContext.getNodeInfo().getChild("<your table node>").getAttribute("drop_attrib").getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();

// populate the valueset with some values , eg:

ValueSet.put("A","A");

ValueSet.put("B","B");

ValueSet.put("C","C");

ValueSet.put("D","D");

Or if values are stored in an array or list then

for(int i=0;i<array size();i++)

{

ValueSet.put(key, value)

}

Hope this may help you.

Deepak!!!