cancel
Showing results for 
Search instead for 
Did you mean: 

Populating elements in Droopdown box

Former Member
0 Kudos

Hi,

Which function is used to to populate the values in Dropdown box dynamically by using Webdynpro for java?

Thanks & regards,

Mastanvali Shaik

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To populate drop down by key


	  ISimpleTypeModifiable modifiable = wdContext.getNodeInfo().getAttribute("Your Attribute").getModifiableSimpleType();
	  if( modifiable.hasSVService() )
{
	  ISimpleValueServices simpleValueServices = modifiable.getSVServices();
	  IModifiableSimpleValueSet simpleValueSet = simpleValueServices.getModifiableSimpleValueSet();
	  
	  for(int x=0; x<10;x++)
	  {
		  simpleValueSet.put(String.valueOf(x), String.valueOf(x));
	  }
}

Drop Down By Value



//create a node lets say orders, if you dont need a empty row set the selection cardinality to 1..1
	  for(int x=0; x< 10; x++)
	  {
		  IOrdersElement element = wdContext.nodeOrders().createAndAddOrdersElement();
		  element.setOrderType(String.valueOf(x));
	  }

Answers (1)

Answers (1)

former_member197348
Active Contributor
0 Kudos

Hi Mastan,

Create a context attribute. Bind this to Dropdown box value property.

IWDNodeInfo info = wdContext.getNodeInfo();
IWDAttributeInfo aidInfo = info.getAttribute("+name+");
ISimpleTypeModifiable aidType =
aidInfo.getModifiableSimpleType();
ISimpleValueServices aidServices = aidType.getSVServices();
IModifiableSimpleValueSet aidVset =
aidServices.getModifiableSimpleValueSet();
for(// loop...)	
{
//fill the  value set
aidVset.put(+key+, +value+);
}

regards,

Siva

Former Member
0 Kudos

Hi Ayyapparaj and Siva Rama Krushan,

Thanks alot for your responses.

Regards,

Mastanvali Shaik