cancel
Showing results for 
Search instead for 
Did you mean: 

How to Select a value from DropDownByIndex -Urgent

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

You can do something like this,

wdContext.nodeStatus().getStatusElementAt(0).setStatus("New");

wdContext.nodeStatus().setLeadSelection(0);

Similarly for Priority.