cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with setting Lead with DropDownByKey and SimpleType-Enumeration

Former Member
0 Kudos

Hi all,

I have got a dropdownbykey-list which is filled by a simple-type enumeration which contains 6 key-value-entries.

I have got the following problem:

After starting the webdynpro-application the second entry of the enumeration should be set as leadselection automatically. How can I realize this?

Thank you in advance for your help?

Best regards, Patrick.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You enter a line in wdDoInit method, e.g.

if (wdContext.nodeName().size() > 1) {
wdContext.nodeName().setLeadSelection(1);
}

Good luck,

Roelof

Answers (4)

Answers (4)

Former Member
0 Kudos

I already got it right now. Thank you for your fast and good answers!

Kind regards, Patrick.

Former Member
0 Kudos

The *ByKey binding type has nothing to do with lead selection. Simply set the value of the context attribute (to which DDBK.selectedKey is bound) to the needed key initially.

Armin

Former Member
0 Kudos

Hi,

find the size of node ur attribute is reside for DD.

for (int idx = 0; idx <= size; idx++)

{

IPrivateOrder<ApplicationView>.I<outputnode>Element val =(IPrivate<ApplicationView>.I<outputnode>Element)wdContext.node<outputnode>().getElementAt(idx);

wdContext.node<outputnode>().setLeadSelection(-1);

}

Try like this.

thanks,

Lohi.

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi Patrick

Just set a value of the context attribute to which 'selectedKey' property is bound to the second item.

ISimpleType stype = wdContext.getNodeInfo().getAttribute("<attrName>").getSimpleType();
ISimpleValueSet valueSet = stype.getSVServices().getValues();
wdContext.currentContextElement().set<attrName>(valueSet.getKey(1));

BR

Sergei

Message was edited by:

Siarhei Pisarenka

Message was edited by:

Siarhei Pisarenka