on 11-10-2010 4:31 PM
Hi,
This is on webdynpro java on NWDS7.0.
I have 10 fields(say,employee records) in R3 -get values from R3-populate into a table in the view. First 9 fields i take from R3 but the 10th field(say,percentage field) must be binded to a context created myself and then bound to the R3 node. i tried the below but i dont get the expected value:
code:
NODE: Percentage_NA:
{
IPrivateXXXView.IPercentage_NAElement newPrtgElement;
int tableData = wdContext.nodeBAPI().size();
for(int i=0;i<tableData;i++){
String prcntg = wdContext.currentBAPI().getZpercentage();
newPrtgElement = wdContext.createPercentage_NAElement();
newPrtgElement.setPercentage_na(prcntg);
wdContext.nodePercentage_NA().addElement(newPrtgElement);
wdContext.nodePercentage_NA().bind(newPrtgElement);
wdContext.nodeBAPI().moveNext();
}
-
RESULT: i get all values same in the output, though i used moveNext().
AnyHelp???
Hi,
Try the following steps:
1. create a value node in the component controller of the WD project say "TableNode"
2. Copy the attributes from the RFC output node and paste them under the "TableNode"
3. After the model is executed, write the below code to copy all the 9 values from RFC node to "TableNode"
//This will copy all the 9 values from Model node to the Value node. No need of a for loop
//Make sure the name and type of the attributes in both Source and target node should be same, else the values will not be copied. Make sure u perform step 2 properly. Do not create on your own
WDCopyService.copyElements(wdContext().node<ModelOutputNodeName>(), wdContext().nodeTableNode());
4. Create 10th attribute under the "TableNode" say "percentage".
5. Write the below code after copying the elements
int tableNodeSize = wdContext().nodeTableNode().size();
for(int i = 0; i < tableNodeSize; i++)
{
ITableNodeElement tableNodeElement = wdContext().nodeTableNode().getTableNodeElementAt(i);
<type> <object> = tableNodeElement.get<attributeName>();
if(condition)
{
tableNodeElement.setPercentage(<value>);
}
}
6. Create a context binding for the TableNode in the View from the controller and bind it to the table
This will work
Regards,
Poojith MV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
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.