cancel
Showing results for 
Search instead for 
Did you mean: 

default value of DropDownByIndex

Former Member
0 Kudos

hello,

i am searching for the possibility to access the default value of a dropdown element in java WebDynpro. I exactly mean the "blank" value in the top of a drop down box.

In my scenario i want to display different data in a table related to the selected values in the drop down box. If the user choose the "blank" data should be diplayed as well.

does anyone have a idea??

thanks in advance,

regards,

rene

Accepted Solutions (1)

Accepted Solutions (1)

roberto_tagliento
Active Contributor
0 Kudos

This line set to the default FIRST LINE BLANK

wdContext.nodeYOUR_NODE().setLeadSelection(-1);

This control say you if BLANK line is selected

if (wdContext.nodeYOUR_NODE().getLeadSelection(-1) == -1){

//BLANK CASE

}

Former Member
0 Kudos

Roberto,

your code is not correct.

Armin

Former Member
0 Kudos

Hello,

Thanks for your posts. But i still have some questions.

I assume that wdContext.nodeSomeNode() points to the node where the attribute is in, which relates to the entries in my drop down box, am I right? If so, i still get a null pointer exception even when i apply the code Armin suggested. I still can't handle the "blank" value.

Any ideas?

regards + thx in advance

Rene

PS: @ Lohi: i would like to display all data, when choosing "blank".

Former Member
0 Kudos

Hello,

i solved it. The problem with the null pointer exception was not caused by the coding Arming suggested. Arming your solution helped me. Thanks!

best regards,

Rene

Answers (2)

Answers (2)

Former Member
0 Kudos

A DropDownByIndex displays an empty value if the node to which it is bound has no lead selection.

Example:

dropdown.texts -> SomeNode.SomeAttribute

if (wdContext.nodeSomeNode().getLeadSelection() == IWDNode.NO_SELECTION)
{
  /* drop-down displays empty value */
}

Armin

Former Member
0 Kudos

hi

If I get your problem correctly you are trying to display data in the table that has beeb selected from the dropdown.if this is the case then what do you expect to be displayed when a blank is seleced.

thanks

Lohi.