cancel
Showing results for 
Search instead for 
Did you mean: 

Creation of dynamic dropdown

Former Member
0 Kudos

Hi,

I am trying to create a dropdown at runtime.Following is the context structure i am using

Wdcontext

nodeProperty

nodeAllowedValues - singleton node

Value - attribute

I am binding the "value" attribute of the node allowed values to the dropdown.I am filling the context attribute value at runtime.But the dropdown values are not filled in the UI.

The following is the code snippet.

Iterator propIt = wdContext.nodeProperty().iterateElements();

while(propIt.hasNext())

{

element= (IPropertyElement)propIt.next();

IWDTransparentContainer transContainer = (IWDTransparentContainer) view.getElement("TransparentContainer");

IWDToolBarDropDownByIndex ddByIndex1 = (IWDToolBarDropDownByIndex) view

.createElement(IWDToolBarDropDownByIndex.class,

"DropDown" + UUID );

ddByIndex1.setEnabled(true);

ddByIndex1.bindTexts(element.nodeAllowedValues().getNodeInfo().getAttribute("Value"));

transContainer.addChild(ddByIndex1);

}

Please Help.

Regards

Vasudha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

First, why do you need to create the drop-down list(s) by code?

- The code you have posted obviously creates as many drop-down lists as there are elements in the node "nodeProperties". Is that what you want?

- You are creating ToolBar* drop-down lists. Why?

- What is UUID?

Armin

Former Member
0 Kudos

Hi Armin,

Yes this is what i would need

ToolbarDropdown is a mistake, i tried with IWDDropDownByindex as well.

UUID is the string, which would uniquely identify the dropdown, since there are many dropdowns created

Regards

Vasudha

Former Member
0 Kudos

Well, if you want to create several drop-down lists (ByIndex), you also need separate context nodes for the data-binding. Binding to the same node will not give you what you want.

Creating a UUID is not necessary, just pass NULL as ID.

Armin

Former Member
0 Kudos

Thanks for the Help.The problem is solved

Answers (1)

Answers (1)

former_member201361
Active Contributor
0 Kudos

Hi ,

try the same code with the Dropdown byKey.

Thanks and Regards