on 05-19-2005 4:55 PM
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
To avoid confusion:
- How does your context look at design time?
- Are NodeA1,... nodes or node elements?
- Which nodes are singletons?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.