on 01-09-2006 2:06 PM
I got a table with nodes with the context:
Person
- ID
- Name
All the nodes is listed in a table in dynpro. My problem is that i want a certain node default selected in the table. All i know is the ID of the node. Got any suggestion of how to do this?
Hi Kristoffer,
What do you mean by <b>nodes</b>? Are you talking about value node which we create through context or is it something else. The code i have given is for a value node Person which will be mapped with the datasource property of the table and it contains two attributes ID and Name.
So please explain on your scenario.
Regards,
Jaydeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, Its a valuenode that is created in the context.
Lets say you have this context: Persons (node)
Name (value attribute), ID (value attribute)
This is binded to a table, that could look like this:
1 K.E
2 O.C
3 L.A
In dynpro tables you can set one row to be selected.
I get an ID as an input paramter i.e 2. Then i want the row with the ID 2 to get selected. If thats not possible, i want to set the the row with the ID 2 on top.
Hi Kristofer,
Let us say you have the value to be checked in a string 'str'.
IPrivate<View_name>.IPersonsElement elmt;
for(int i=0;i<wdContext.nodePersons().size();i++)
{
elmt = wdContext. nodePersons().getPersonsElementAt(i);
if(elmt.getID().equals(str);
{
wdContext. node<node_name>().setLeadSelection(i);
break;
}
}
Hope this helps you,
Best Regards,
Nibu.
Thanx... I tried it now, but it doesnt seem to work.
The node that is selected the first time, is selected every time i go to the table with the nodes.
I.E i select row 2 in the table, and go out.. go back to the table and the row 2 is selecten.. even that it the input paramter is something else..
hi Kristoffer,
U can use the following peice of code
wdcontext.nodePersonNode().currentPersonNodeElement().setCurrentID("<Your Default ID>");
Regards,
Jaydeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.