on 04-28-2010 9:27 PM
Hello-
I'm using DAO Bean in a Web Dynpro Project. I have a table that is sourced from one of the objects, TableDataBO. Within TableDataBO I will have 4 columns and 1 of the columns needs to have a dropDown, called Fruits. FruitDataBO is also from same DAO.
How can I create a dropDownByIndex with selections from FruitDataBO but with it's value selected to the previously selected Fruit that is listed in TableDataBO.
For example, apple,orange,banana,pear.
TableDataBO.getFruit is orange. I'd like user to see the dropdown list and it be selected to orange. I'm not sure how I can implement this.
Thanks in advance.
Marty
Hi Marty,
For this you have to create 2 nodes
1. A node which will be bound to the table. This will be a singleton node.
2. A node for dropdown. This node should be inside the table node and should be a non-singleton one.
Check the singleton properties of both the nodes above.
Whenever you will create an element for table node, an instance of the dropdown node will be automatically created.
To set the value in this dropdown at leadselection, you can use the below logic
1. Assume you know the value of the fruit to be set in the dropdown
2. for(int i = 0; i < wdContext.nodeFruit().size(); i++)
{
if( wdContext.currentTableNode().nodeFruit().getFruitElementAt(i).getFruit().equals(fruitName) )
{
wdContext.currentTableNode().nodeFruit().setLeadSelection(i);
break;
}
}
Hope this helps you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Marty,
Add a dropdownbyindex UI element to the Table column and bind it to a Context Node attribute with the Structure:
FruitDDByIndex
--FruitSelected
and in the code set DD of every row in the table.
for(int i = 0; i < <TableNodeSize>; i++)
{
<TableNodeObject> = wdContext.node<TableNode>.get<TableNode>ElementAt(i);
//Get the value to be selected
<TableNodeObject>.nodeFruitDDByIndex().getFruitDDByIndexAt(wdContext.nodeFruiDDByIndex().getLeadSelection).setFruiSelected(<value>);
}
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 |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.