cancel
Showing results for 
Search instead for 
Did you mean: 

Populating drop-down list

Former Member
0 Kudos

Think the issue I have is a different flavor of the issue covered by this topic. Just re-phrasing my question to make things clear. Need to populate dropdown list at runtime with node elements. The structure is as follows.

NodeA

-


NodeA1

-


NodeA11

-


Element1

-


Element2

-


Element3

-


NodeA2

-


NodeA21

-


Element1

-


Element2

-


Element3

-


NodeA3

-


NodeA31

-


Element1

-


Element2

-


Element3

NodeA created at design time. Node elements A1,A2 and A3 are created at runtime. Based on the lead node (A1 or A2 or A3), need to re-populate dropdownlist with elements 1,2, 3 etc. Is this possible ?

Thanks for your time !

Sri

Message was edited by: Armin Reichert

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

To avoid confusion:

- How does your context look at design time?

- Are NodeA1,... nodes or node elements?

- Which nodes are singletons?

Armin

Former Member
0 Kudos

At design time we have NodeA (singleton). Node A1, A2 are created at runtime, and I assume they are node elements.

Node elements are singletons as well. I hope this clarifies your question.

Appreciate your help !

Sri

Former Member
0 Kudos

How are A1, A2, ... created, using IWDNode.createElement()? Then they are node <b>elements</b>, not nodes.

The singleton-property defines a relation between a node and its parent node.

If a node is a singleton, then (at runtime) there exists only one instance of this node for all node elements of its parent node.

If a node is a non-singleton, then each node element of its parent node has its own instance of this node.

See also "Inside Web Dynpro", page 67..

Can you clarify this for your example?

Armin

Former Member
0 Kudos

Yes, A1, A2 are ndoe elemnts created using IWDNode.createElement(). Code snippet to create Node elements A1, A2 etc. and their child node elements A11, A21 etc. is pasted below.

I really appreciate you taking the time to clarify this issue.

//load sales orgs from rule engine and populate context nodes

ProductionSourceLoadingRuleContainer prodRuleCont = ProductionSourceLoadingRuleContainer.getInstance();

//create list of fields to generate the field descriptors for

Vector fieldList = new Vector();

fieldList.addElement("DChainSpecStatus");

fieldList.addElement("DChainFromDate");

fieldList.addElement("DeliveringPlant");

fieldList.addElement("CashDiscount");

fieldList.addElement("TaxClassification");

fieldList.addElement("MinOrderQty");

fieldList.addElement("MinDeliveryQty");

fieldList.addElement("DeliveryUnit");

fieldList.addElement("MaterialStatGrp");

fieldList.addElement("MaterialPrcGrp");

fieldList.addElement("CommissionGrp");

fieldList.addElement("ItemCatGrp");

fieldList.addElement("MaterialGrp1");

fieldList.addElement("MaterialGrp3");

fieldList.addElement("MaterialGrp4");

fieldList.addElement("MaterialGrp5");

fieldList.addElement("MaterialGrp5");

fieldList.addElement("PriceSheetInd");

fieldList.addElement("ECatalogInd");

fieldList.addElement("TradePriceMultiplier");

fieldList.addElement("BrandCode");

fieldList.addElement("ProductAttribute5");

//add attributes as necessary

for(Iterator itr = prodRuleCont.getSalesOrgs().iterator() ;itr.hasNext();){

String currentSalesOrg = (String)itr.next();

//create a sales org node for each sales org and add attributes that correspond for each field in sales org view

IWDNodeInfo salesOrgs = wdContext.nodeSalesOrgs().getNodeInfo();

IWDNodeInfo salesOrg = salesOrgs.addChild(currentSalesOrg,null,true,true,true,false,false,true,null,null,null);

//each element in the enumeration represents a field name, and needs to be added to the sales org as a field descriptor

Enumeration fields = fieldList.elements();

while(fields.hasMoreElements()){

IWDNodeInfo salesOrgElement = salesOrg.addChild(currentSalesOrg+fields.nextElement(),null,true,true,true,false,false,true,null,null,null);

salesOrg.addAttribute("defaultValue","ddic:com.sap.dictionary.string");

salesOrg.addAttribute("labelValue","ddic:com.sap.dictionary.string");

salesOrg.addAttribute("labelID","ddic:com.sap.dictionary.string");

salesOrg.addAttribute("readOnly","ddic:com.sap.dictionary.boolean");

salesOrg.addAttribute("required","ddic:com.sap.dictionary.boolean");

salesOrgElement.addChild(fields.nextElement()currentSalesOrg"Set",null,true,true,true,false,false,true,null,null,null);

IWDNode node = wdContext.wdGetAPI().getRootNode().getChildNode(currentSalesOrg+fields.nextElement(),IWDNode.LEAD_SELECTION);

IWDNodeElement nodeElem = node.createElement();

nodeElem.setAttributeValue("defaultValue","");

nodeElem.setAttributeValue("labelValue","");

nodeElem.setAttributeValue("labelID","");

nodeElem.setAttributeValue("readOnly","");

nodeElem.setAttributeValue("required","");

//IWDNode nodeSet = wdContext.wdGetAPI().getRootNode().getChildNode(currentSalesOrgfields.nextElement()"Set",IWDNode.LEAD_SELECTION);

//IWDNodeElement nodeElemSet = nodeSet.createElement();

//nodeElemSet.setAttributeValue("element1","");

node.addElement(nodeElem);

//nodeSet.addElement(nodeElemSet);

}

}

wdContext.nodeSalesOrgs().setLeadSelection(0);

Hope this helps !

Sri

Former Member
0 Kudos

Forgot to mention. All nodes elements are singletons.

Thanks !

Former Member
0 Kudos

Armin,

Sorry, I was wrong....

NodeA is Independent singleton node...

All other nodes are independent non-singleton nodes....

Similar to the Figure 6.3 in the book.

Hope this helps !

Sri

Former Member
0 Kudos

Previous reponse should read...

"All other nodes are dependent singleton nodes"......

Thanks !