on 03-14-2008 10:08 AM
Hi All,
I am new to Webdynpro. I have an table in my view and in one column i have to have one drop down list. i added it in UI.
in context i created an node for table and added the attributes and a child node for drop down. in child node i have one attribute.
Problem is , when i create an element for table, i am not able to create child node element and i dont know how to do this.
so i am not able to populate drop down list.
i gave singleton as false for child node.
please let me know how can i populate the child node
Many Thanks in advance,
Senthil
hai
try this code,table parteners is a table node and its contains another node subnode.
public void wdDoInit()
{
//@@begin wdDoInit()
//MATERIAL INPUT FIELD in TABLE RFC(GETTING DATA FROM DB)
try
{
//table declaration
IPrivateSalesdet.ITableElement element;
IPrivateSalesdet.ITableNode node=null;
pnode=wdContext.nodeTablepartners();
for(int j=0;j<5;j++)
{
try
{
pe1=pnode.createTablepartnersElement();
pnode.addElement(pe1);
wdContext.nodeTablepartners().moveTo(j);
IPrivateSalesdet.ITablepartnerssubnodeElement element2;
IPrivateSalesdet.ITablepartnerssubnodeNode node2=null;
IPrivateSalesdet.ITablepartnerssubnodeElement pe2;
IPrivateSalesdet.ITablepartnerssubnodeNode pnode1=wdContext.nodeTablepartners().nodeTablepartnerssubnode();
pe2=pnode1.createTablepartnerssubnodeElement();
pnode1.addElement(pe2);
}
wdContext.nodeTablepartners().moveFirst();
// partnerstablesubnode declaration
}catch()
{
}
Thanks n Regards
Sharanya.R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sharanya,
it was very helpful but i am getting as many number of times each value in drop box as number of rows.
for few rows no value at all for drop down box.
i want to have only "passed", "failed" in each drop box of every row.
this is the code i am using now,
IStatusTableNode nd = wdContext.nodeStatusTable();
For -loop
IStatusTableElement ele = (IStatusTableElement)nd.createStatusTableElement();
ele.setAttributeValue("Scenario", scenarioname);
ele.setAttributeValue("ScenarioId", scenvarid.substring(0,scenvarid.indexOf("_") ));
ele.setAttributeValue("ScenarioVariant", scenvarid);
ele.setAttributeValue("BPVT", bpvts<i>);
nd.addElement(ele);
wdContext.nodeStatusTable().moveTo(i);
IBPVTStatusNode BPVT = wdContext.nodeStatusTable().nodeBPVTStatus();
IBPVTStatusElement el = BPVT.createBPVTStatusElement();
el.setStatus("Passed");
BPVT.addElement(el);
el = BPVT.createBPVTStatusElement();
el.setStatus("Failed");
BPVT.addElement(el);
wdContext.nodeStatusTable().moveFirst();
end of for loop
what i am doing wrong?
Thanks,
Senthil
It's much easier.
To add elements to the drop-down list in table row #i, do something like
IStatusTableElement row = wdContext.nodeStatusTableElement().getStatusTableElementAt(i);
String[] values = { "Passed", "Failed" };
for (int i = 0; i < values.length; ++i)
{
IBPVTStatusElement status = row.nodeBPVTStatus().createBPVTStatusElement();
row.nodeBPVTStatus().addElement(status);
status.setStatus(values<i>);
}
Armin
Hi,
Set the cardinality of your child node as 1..1
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai,
give the same coding that you have given to create the node elements(root). for your child nodes also.
Thanks n Regards
Sharanya.R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sharanya,
THis is the code,
IStatusTableNode nd = (IStatusTableNode)wdContext.getChildNode("StatusTable",0);
IStatusTableElement ele = (IStatusTableElement)nd.createStatusTableElement();
ele.setAttributeValue("Scenario", scenarioname);
ele.setAttributeValue("ScenarioId", scenvarid.substring(0,scenvarid.indexOf("_") ));
ele.setAttributeValue("ScenarioVariant", scenvarid);
IBPVTStatusNode BPVT = (IBPVTStatusNode)nd.getChildNode("BPVTStatus", 0);
IBPVTStatusElement el = BPVT.createBPVTStatusElement();
el.setStatus("Passed");
BPVT.addElement(el);
nd.addElement(ele);
BPVTStatus is the child node.status table is the root node.
Thanks,
Senthil
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.