Skip to Content
author's profile photo Former Member
Former Member

Controlling Drop Down List

Hi

1) I'm using a Value Help DDL which is populated from WD. So far, the DDL works but I would like to have the first item displayed in the list field when the form is initially rendered. Actually the field is empty and I have to select a value from the the list.

2) Whenever the value of the DDL is being changed I need to determine the index of the selected list entry in order to retrieve other data.

Any hint to these concerns would be appreciated.

René

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Jan 05, 2007 at 03:38 AM

    Hello Rene,

    For example, if you have a context structure as follows:

    Context

    DDLBData (datasource node)

    ValueHelpDDLB (context attribute mapped to DDL)

    then you can default a value immediately after the population of the DDL as follows:

    wdContext.nodeDDLBData().currentDDLBDataElement().setValueHelpDDLB(key);

    About the second question, you do not have any automatic way to get the index of the selected item. But you can easily do it just by employing your own mechanism. Maybe, by maintaining a HashMap or some other mechanism. In Web Dynpro you have DropDownByIndex DDL but there is no such DDL in Adobe forms.

    Hope that helps.

    Thanks,

    Krishanu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2007 at 03:01 PM

    Hi ,

    Is this is developed in webDynpro Adobe in Java ?

    Are you using the following code to fill the Drop Down list box ?

    Code in wdInit()

    ===========

    IWDAttributeInfo attInfo =wdContext.nodeContext().getNodeInfo().getAttribute("Name");

    ISimpleTypeModifiable attType = attInfo.getModifiableSimpleType();

    IModifiableSimpleValueSet attValueSet =attType.getSVServices().getModifiableSimpleValueSet();

    attValueSet.put("0","Value");

    In Enter event of drop down list

    ========================

    var jsToExecute = "event.target.SAPValueHelp(\"" + this.somExpression + "\");";

    app.eval(jsToExecute);

    For this when you select any value from drop down list box you can get the index of selection using the following code

    int cnt

    cnt =Integer.parseInt( wdContext .nodeContext().currentContext() .getName());

    It gives you the index of the selection.

    Please let me know if you need any info .

    Regards,

    Nanda

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 07:40 AM

    Hi

    Thanks for your contributions. Setting the initial value of the DDL now works fine. Maybe my problem description was a little bit confusing. The DDL is part of an interactive form and its list data is provided by the underlying WD/Java. So what I need is to determine the index of the selection within the script of the change or exit event of the interactive form. This index should be used to retrieve further data fom another list in context data of the interactive form.

    Any suggestion to resolve this requirement would be appreciated.

    René

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.