cancel
Showing results for 
Search instead for 
Did you mean: 

drop down not populating after submit action

Former Member
0 Kudos

Hi,

I have a requirement to populate drop down values in WDJ application after hitting "submit" action.

I am able to populate the drop down values in "wdDoInit()" method. But, when I create an action named "submit" and hitting enter, the drop down value is not populated. But, the action is triggering. when I populate another input element with dummy value, it is getting populated where as dropdown values are not populated.

public void onActionsubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
IWDAttributeInfo costCenterInfo = wdContext.nodeValue().getNodeInfo().getAttribute("costcenter");

ISimpleTypeModifiable costCenterType = costCenterInfo.getModifiableSimpleType();

IModifiableSimpleValueSet costCenterValueSet = costCenterType.getSVServices().getModifiableSimpleValueSet();


costCenterValueSet.put("1","London");

costCenterValueSet.put("2","Birmingham");
}

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

On the view take a ui element dropdown by Key and on selectedKey Property bind it to the context attribute u201Dcustomeru201D.

And on action of the button write the following code.

ISimpleTypeModifiable smp =

wdThis.wdGetAPI().getContext().getModifiableTypeOf("costcenter");

IModifiableSimpleValueSet value =

smp.getSVServices().getModifiableSimpleValueSet();

value.put("1","London");

value.put("2","Birmingham");

regards,

shahebaz

Former Member
0 Kudos

Try clearing the ValueSet before putting the new values and check.Code will be as below

public void onActionsubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
IWDAttributeInfo costCenterInfo = wdContext.nodeValue().getNodeInfo().getAttribute("costcenter");
 
ISimpleTypeModifiable costCenterType = costCenterInfo.getModifiableSimpleType();
 
IModifiableSimpleValueSet costCenterValueSet = costCenterType.getSVServices().getModifiableSimpleValueSet();
costCenterValueSet .clear();
  
costCenterValueSet.put("1","London");
 
costCenterValueSet.put("2","Birmingham");
}

Former Member
0 Kudos

Hi Charan,

Pl check the cardinality of the node.

Pl check you have created the element of that node then set the dropdown element. Also try printing the success messages in the loop with the try catch block around it.

Regards

Piyush Bhurangi