cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to populate the dropdown by key from webservice

Former Member
0 Kudos

My dropdown by key field is not beeing populated. I have the following code in my wdDoInit method of my component controller. I have binded the dropdown by the attribute OutCatname in the layout of my view.

IWDAttributeInfo info=wdContext.nodeBAMSCategoryDetails().getNodeInfo().getAttribute("OutCatname");

ISimpleTypeModifiable st=info.getModifiableSimpleType();

IModifiableSimpleValueSet valueSetCategory = st.getSVServices().getModifiableSimpleValueSet();

// Add a empty choice for default.

valueSetCategory.put(new String(""), new String(""));

// Populate the simple value set with the data from the model node.

for (int i = 0; i < this.wdContext.nodeBAMSCategoryDetails().size(); i++)

{

valueSetCategory.put(wdContext.nodeBAMSCategoryDetails().getBAMSCategoryDetailsElementAt(i).getOutCatname(),

wdContext.nodeBAMSCategoryDetails().getBAMSCategoryDetailsElementAt(i).getAttributeAsText("OutCatname"));

}

Any help will be appreciated.

Thanks

Nahman

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Nahman,

I am having the same requirement, My dropdown is getting populated. Now I would like to know how to set a default value from this valueSetCategory.

Points will be rewarded.

Thanks & Regards,

Raj.

Former Member
0 Kudos

Hi Raj,

In the Context node set the cardinality--->1.n and selection 1.1

the u got the default value incase of using the dropdownbyindex.

Regards,

P.Manivannan

Former Member
0 Kudos

Hi Raj,

In the Context node set the cardinality--->1.n and selection 1.1

the u got the default value incase of using the dropdownbyindex.

Regards,

P.Manivannan

Former Member
0 Kudos

hi,

This dropdown list is genetrated dynamically. Please let me know any other work around for this.

Regards,

Raj.

Former Member
0 Kudos

My code was right it was that my cardinality was not set right.

Thanks for your quick response.

monalisa_biswal
Contributor
0 Kudos

Have you checked the size of model node?Does it contain data?

It may be empty i think.

Former Member
0 Kudos

I don't understand this code.

Can you please tell

- How the context structure looks like

- Where the key/value-pairs are stored that should be filled into the value set

- Where the attribute for the selected key is located in the context

Armin