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

problem with implementing down drop list

Hi expert,

I want to implement a down drop in my list for selection.

I have created a have simpleType, roType in component controller's context and at the same time a roSelected of type String. I have also map those to the attribute in the view controller's context.

I have retrieved the selection list from the Application Services and want to populate the down drop list for selected. Thus in my component controller, I have this:

/* component controller * /

public void wdDoInit() {

...

IContextElement contextElement = wdContext.currentContextElement();

ISimpleTypeModifiable roType = wdThis.wdGetAPI().getContext().getModifiableTypeOf("roType");

IModifiableSimpleValueSet<String> roValueSet = roType.getSVServices().getModifiableSimpleValueSet();

roValueSet.put("index_0", "name 1");

roValueSet.put("index_1", "name 2");

roValueSet.put("index_2", "name 3");

contextElement.setROType("name3");

}

I have also bind the onSelected in the ViewController to the attribute - roSelected.

i have also link all to callable object to GP.

// also with the following

public void execute (com.sap.caf.eu.gp.co.api.IGPExceutionContext executionContext) {

...

try {

this.executionContext = executionContext;

IGPStructure input = executionContext.getInputStructure();

contextElement.setAttributeValue("o_ro", input.getAttributeAsDate("I_RO");

..

}

..

}

However, my drop down didnt list those selected such as name1, name2, name3. Instead, it list, name3.

Can help?

Thank you.

I am currently using CE 7.1 SP3, web dynpro (for java) with integration with GP.

Edited by: aiwei on Jan 21, 2008 11:14 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 21, 2008 at 10:36 AM

    Hi,

    You can try the following code:

    ISimpleTypeModifiable attr = attrInfo.getModifiableSimpleType();

    // where attr is the attribute info of your attr bound to the dropdown.

    IModifiableSimpleValueSet attrValueSet = attr.getSVServices).getModifiableSimpleValueSet();

    String attrValue = {"index_0","index_1","index_2"};

    String attrId = {"name 1","name 2","name 3"};

    attrValueSet.put(attrId,attrValue);

    for(int idx = 0; idx < attrValue.length; idx++){

    attrValueSet.put(attrId,attrValue);

    }

    thats it. Hope it will solve your problem

    thanks & regards,

    Manoj

    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.