on 06-28-2007 8:54 AM
Hi all,
I have a dropdownbyindex UI element in the screen.I mapped it to a node in the context.That node contains one attribute.I have given 10 elements in the dropdown list.I want to display the element selected using the Messagemanager.
What is the code for that.
thank you.
Hi,
Consider the dropdownbyindex node to be "DDBINode" and attribute to which DDBI is mapped as "DDBIText".
In any action taht you trigger, write the below code
wdComponentAPI.getMesageManager.reportSuccess(wdContext.currentDDBINodeElement.getDDBIText());
This will display the DDBI selected value in the view.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<b>Hi
Web Dynpro DropDownByIndex API - IWDDropDownByIndex
http://help.sap.com/saphelp_nw04/helpdata/en/4a/8613e41629344194e4f40393740d51/frameset.htm
Web Dynpro AbstractDropDownByIndex API - IWDAbstractDropDownByIndex
http://help.sap.com/saphelp_nw04/helpdata/en/24/25e08d4ba6c743b55f1d375637ba8d/frameset.htm
Using the IUserObjectBasedNavigation Service
http://help.sap.com/saphelp_nw04/helpdata/en/29/575a421b5ec153e10000000a1550b0/frameset.htm
Code Examples of Data Binding
http://help.sap.com/saphelp_nw04/helpdata/en/95/93fe1e71a2e44691b1f041e67f71aa/frameset.htm
Regards
Chandran</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1)Create node(year)with attribute(month)
2)Bind the month attribute to Dropdownbox
3)Write the below code in wdDoInit()
String[] i_monthname={"January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December"};
List i_year=new ArrayList();
for(int i=0;i<i_monthname.length;i++)
{
IPrivateCompView.YearElement i_mon=wdContext.nodeYear().createYearElement();
i_mon.setMonth(i_monthname<i>);
i_year.add(i_mon);
}
wdContext.nodeYear().bind(i_year);
4)create action for dropdown bt click dropdownbyindex ul element--->properties-->onAction=select
5)write this code in onActionSelect()
wdComponentAPI.getMessageManager().reportSuccess(""+wdContext.currentyearelement.getmonth());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IItemsElement selectedItem = wdContext.currentItemsElement();
wdComponentAPI.getMessageManager().reportSuccess("Selected element: " + (selectedItem == null ? "none" : selectedItem.getText()));
assuming the node is named "Items" and the attribute is named "text".
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
Your solution worked out but i got a new problem.Thank you for solving my previous problem.I have 2 DDBI UI elements in my screen,both are mapped to the same node.I have assigned the different actions for the 2 DDBI.
If i select one value in the 1 DDBI, the other DDBI is also set to the same value.
But my requirement is i have to select 2 different values in the 2 DDBI s and i have to do different manipulations with them.Kindly help me in this matter
Hi,
You use any DDBI or DDBK,if you map the same node to both the DropDowns then when you select one vlue in one dropdown this also becomes the selected value for the other dropdown, since botht the dropdowns are mapped to the same node.Lead selection is at the node/attribute level and not UI element based.
Instead you have to create Two different node and map the DropDowns to respective nodes.
User | Count |
---|---|
88 | |
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.