Hi,
You can populate dropdown values from webservice using the following steps. I assume you have idea about custom controller and better you have to use DropdownbyIndex intead of DropdowmByKey.
step1:
Create custom controller.Inside custom controller Bind input value then execute webservice.
step2:
Now you have value node which is returned from web service. After execute web service you can find size using the following code. create value(Role_Output) node and modelnode(Role_result) object using the code.
Step3:
<custom controller name>.IRole_ResultNode modelnode=wdContext.nodeRole_Result();
<custom controller name>.IRole_OutputNode valuenode=wdContext.nodeRole_Output();
valuenode.invalidate();
int size=modelnode.size();
Step4:
After find size using loop fetch values from model node into value node.Asume in this value node contains key and value.
for(int j=0;j<modelnode.size();j++){
<custom controller name>.IRole_ResultElement modelElement=modelnode.getRole_ResultElementAt(j);
<custom controller name>.IRole_OutputElement valueElement=wdContext.createRole_OutputElement();
valueElement.setId(modelElement.getKey());
valueElement.setText(modelElement.getValue());
valuenode.addElement(valueElement);
}
step5:
After that bind this value node(Role_Output) into Component controller. Then Bind value node(Role_Output) from component controller into view.
Step6:
Finally bind dropdown UI Element into Role_Output node's attribute(ID).
Kind Regards,
S.Saravanan
Add a comment