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

Empty row in UI Element DropDownByKey

Hi there

I have problems with the DropDownByKey UI Element. The one being populated with somme BAPI data works fine, but I want to implement one with the data from an enumeration of a simple type. What I am missing is the possiblity to set the selected element to the first value instead of having an empty row. Any ideas?

Thank you for your help!

Andreas

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 08, 2005 at 06:53 AM

    hi,

    Set teh value of the mapped context attribute to the value of the enumeration u want to display.

    Regards

    Bharathwaj

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member
      final ISimpleType type = (ISimpleType)wdContext
        .myNode()
          .getNodeInfo()
            .getAttribute("MyAttribute")
              .getDataType();
      final ISimpleValueSet values = type.getSVServices().getValues();
      final String defValue = values.size() > 0 ? 
        (String)values.getKey(0) : null;
      wdContext.currentMyNodeElement().setMyAttribute(defValue);
      

      Any checks for nulls, existing of SVS, existing of current element are ommited.

      VS

  • author's profile photo Former Member
    Former Member
    Posted on Jun 08, 2005 at 07:12 AM

    hi,

    What is the built in type for the simple type.. I think it is string ? Check that..

    Did u set it as the type for a context attribute and map the context attribute to the dropdownby key UI element.

    If u have done this you can set the value as

    wdContext.currentContextelement.set<Cont attr name>("the value want to be selected");

    This value u want to select will be of the built in type of the enumeration

    regards

    Bharathwaj

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi

      The built in type is string, that is correct. I did exactly how you said. When I want to to use the setter of the value attribute I get the error that the method needs a type Language instead of String. This is the problem I have. See?

  • author's profile photo Former Member
    Former Member
    Posted on Jun 08, 2005 at 08:38 AM

    Hi,

    Is the simple type created by you or is it created when u had imported the model.

    If its created by you try renaming the smpletype and check if its showing this name in the setter method..

    Or try displaying the current element using the getter method and set the same using the setter method..

    Try all this ! and give the status !

    Regards

    Bharathwaj

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi to all

      I got it solved. The problem was in the definition of the simple type. After unchecking "Generate a class representation of the enumeration" in the tab "enumeration" it is possible to use the setter method with a String parameter.

      Thanks to everyone!

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.