Skip to Content
0
Feb 24, 2006 at 05:04 PM

DropDownByKey inside a Table

13 Views

I need a DropDownByKey Element inside a Table with a row specific valueset.

The following code always returns the same valueset for each row.

// inside suply function with ICatalogEntriesNode node

ICatalogEntriesElement newCatalogEntriesElement = node.createCatalogEntriesElement();

IArtList_DetextsNode nodeDetexts = wdContext.nodeArtList_Detexts();

int sizeDetexts = nodeDetexts.size();

for (int i=0;i<sizeDetexts;i++) {

IArtList_DetextsElement thisDetextsEl = (IArtList_DetextsElement) nodeDetexts.getElementAt(i);

newCatalogEntriesElement = node.createCatalogEntriesElement();

// add dropdown with different values for each node "CatalogEntriesElement" (0..n) -> Value Attribute "SMEIN" (String)

final IModifiableSimpleValueSet valueSet = node.getNodeInfo().getAttribute("SMEIN").getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();

valueSet.put(thisDetextsEl.getMeinh(),thisDetextsEl.getAmein());

valueSet.put(thisDetextsEl.getMeins(),thisDetextsEl.getMeins());

newCatalogEntriesElement.setSMEIN(thisDetextsEl.getMeinh()); // set default value

// Result is, that every dropdown has the same (3 ?!?) values

// add additional elements

newCatalogEntriesElement.setUMREN("xyz");

node.addElement(newCatalogEntriesElement);

}

// end of code

What's the right way to bind the valueSet to each EntryElement?

Maybe there is someone who has the answer/solution.

Thanks, Holger