Skip to Content
avatar image
Former Member

How to Select a value from DropDownByIndex -Urgent

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    May 15, 2007 at 11:57 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    May 15, 2007 at 08:44 PM

    You can do something like this,

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

    wdContext.nodeStatus().setLeadSelection(0);

    Similarly for Priority.

    Add comment
    10|10000 characters needed characters exceeded