Skip to Content
Former Member
Jul 21, 2005 at 12:40 PM

How to bind a DropDown to something other than the lead selection?


Hi everybody,

I want to build a toolbar dynamically.

The context structure looks like this:

ToolbarButtons (non-singleton node)
  +Items (non-singleton node)
  |  |
  |  +Text (string)
  |  +Value (string)
  +Text (string)
  +Tooltip (string)
  +Type (int)

Each ToolbarButtonsElement with Type=1 represents a ToolbarButton, each ToolbarButtonsElement with Type=2 should be a ToolbarDropDownByIndex. If so, the Items in the DropDown are stored in Items node.

I create the UI Elements with the following code:

for (int i = 0; i < tbNode.size(); i++)
	IToolbarButtonsElement tbe = 

	IWDToolBarItem tbItem = null;
	if (tbe.getType() == TOOLBAR_TYPE_BUTTON){ (...) }
	else if (tbe.getType() == TOOLBAR_TYPE_DROPDOWN)
		IWDToolBarDropDownByIndex tbDD = 
				IWDToolBarDropDownByIndex.class, null);
		IWDAttributeInfo ai = wdContext.nodeHeaderData()

		tbItem = tbDD;
	if (tbItem != null) tb.addToolBarItem(tbItem);

This works fine if I only have one dropdown. But if there is more than one, all the items of ALL dropdowns display the (same) Items of the last element of ToolbarButtons.

If I change the lead selection of ToolbarButtons, all the dropdown items change as well.

How can I bind the DropDown Texts to something other than the lead selection?

best regards,