on 12-26-2009 10:18 AM
Hi Experts,
I have created WD Program which fetches following data from R/3:
Code Description
AR Arizona
NY New York
NJ New Jersey
I have created 'Drop Down by Index' UI element. Using the usual mapping I can display either Code or Description. However, as per client requirement I have to display both Code and Description i.e.
AR: Arizona
NY: New York
NJ: New Jersey
I tried few methods. But it is not working.
Please help.
Regards,
Gary
Hello Gary,
Create a copy of the model node in the view controller and then fill it as shown in the code below:-
int size = wdContext.nodeCountrylist_out().size();
String descp = "",code = "", descp_new = "";
for (int i = 0; i < size ; i++)
{
IPrivateTest1.ICountrylist_out_1Element cpyel = wdContext.createCountrylist_out_1Element(new Countries());
descp = wdContext.nodeCountrylist_out().getCountrylist_outElementAt(i).getdesc();
code = wdContext.nodeCountrylist_out().getCountrylist_outElementAt(i).getcode();
descp_new = code + ":" + descp;
cpyel.setcode(code);
cpyel.setLandx(descp_new);
wdContext.nodeCountrylist_out_1().addElement(cpyel);
}
hope this will hep.
Regards,
Sarbjeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gary,
Follow the steps.
1. Create value node Vn_Region.
2. Create 3 attributes within Va_Code, Va_Name and Va_Desc.
3. In the code to get code and name from R3, set Va_Desc as Code+Name.
String name,code,desc;
for(int i=0;i<wdContext.node<REG>().size();i++){
code=wdContext.node<REG>() .get<REG>ElementAt(i).get<code>();
name=wdContext.node<REG>() .get<REG>ElementAt(i).get<name>();
desc= code + " , " + name;
}
Regards,
Tushar Sinha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Try this: create value node - create the ID attribute and the description. The ID should be the ID from the data you got from R3 - then just loop through the model node and append the data you want.
Bind the drop down with this node.
I'm not sure if there's a quicker way though. Goodluck.
Regards,
Jan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gary
Calculate the size of the model node.
Now loop through this node.
In the node to which your drop down is bound, have an attribute say va_combined.
In your loop set va_combined = code+description OR desccripion +code (description and code come from the model node)
Bind the text property of your drop down to this va_combined.
Regards,
Himanshu
I don't have NWDS to assist but it should go like this
int size = wdContext.nodeRFCNode.size();
String stateID = "";
String description = "";
for(int i = 0; i < size; i++){
stateID = wdContext.nodeValnode().getElementAt(i).getAttributeValue("stateID");
description = wdContext.nodeValnode().getElementAt(i).getAttributeValue("description");
//set the value here to that value node containing the joined String
}
Good luck!
Regards,
Jan
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.