on 05-15-2007 9:36 PM
Hi All,
I have dropdownbyindex UI elements in my Views, I get values from BAPI. When click records in a table, It goes to another view to display full record. Here i have dropdownbyIndexes So it should select one of appropriate value in dropdownbyindex based on record(Value) in table.
Example:
<u><i><b>In Table View</b></i></u>
id title status priority
10000 webDynPro New Low
<i><u><b>Detail View:</b></u></i>
id 10000
title webDynPro
Status New [New,Old,Open,Closed]---DropDownbyIndex
Priority Low [High,Low,Medium]---DropDownByIndex..4m BAPI
How to select Appropriate Values from DropdownbyIndex. if any one has sample code, that will be helpful.
Note: I am using Model Nodes
Thanks and Regards
Ravi Golla
Hi Ravi,
In details view, you will have corresponding context node created for Status and priority dropdown fields.
Let suppose, context node for Status is, StatusNode.
value attribute inside this is,
StatusNode
|_ StatusAttrib
Now, you need to write following code to set l_status ="LOW" value in it.
wdContext.nodeStatusNode().moveFirst();
for(int i=0; i<wdContext.nodeStatusNode().size(); i++)
{
if(wdcontext.currentStatusNodeElement().getStatusAttrib().equals(l_status)
{
wdContext.nodeStatusNode().setLeadselection(i);
break;
}
wdContext.nodeStatusNode().moveNext();
}
write same code for priority also.
Let me know if it is not working with you.
regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhavik,
Thanks for giving code. Presently i am working on it. Because in your code only select one entry. But if user clicks other value?
wdContext.nodeStatusNode().moveFirst();
for(int i=0; i<wdContext.nodeStatusNode().size(); i++)
{
if(wdcontext.currentStatusNodeElement().getStatusAttrib().equals(l_status)
{
wdContext.nodeStatusNode().setLeadselection(i);
break;
}
wdContext.nodeStatusNode().moveNext();
}
i'm trying to implement your code according to my design. i am giving reward points for it. You almost solved my problem.
Thanks for your time and code
Regards
Ravi Golla
You can do something like this,
wdContext.nodeStatus().getStatusElementAt(0).setStatus("New");
wdContext.nodeStatus().setLeadSelection(0);
Similarly for Priority.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.