cancel
Showing results for 
Search instead for 
Did you mean: 

Some questions about Web Dynpro dropdowns

Former Member
0 Kudos

Hello,

I feel bad even asking something this basic but I've tried and tried and no matter how I search I can't find any documentation about this.

I want my web dynpro screen to show a dropdown that contains a list of items a user can pick from. My questions are:

1) If I want the list to be static, how can I run some initialization logic to populate the dropdown when the app is started?

2) There seem to be three different ways of creating a dropdown: DropDownByIndex, DropDownByKey and ItemListBox. What is the difference between them?

Thanks in advance for any help!

David.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Lohitha,

Thanks for your reply. I was able to get to the 1st and last links but not the middle 2.

The last link looks like it'll be useful to me. I've assigned some points to thank you for your feedback.

David.

Answers (2)

Answers (2)

ReenaWadhwa
Advisor
Advisor
0 Kudos

Hi,

You can use following code to get system date and day.

public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss";

Calendar cal = Calendar.getInstance();

SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);

sdf.format(cal.getTime());

you can specify format according to you and can get day, date and time.

Reena

Former Member
0 Kudos

hi,

if you want the list to be static then create a simple type in local dictionary and enter the value in the enumeration.

Difference between dropdown by key and dropdown by index is <b>key</b> list all the values available domain level at the run time if it is binded to the model attribute.

Dropdown by index is used to populate the values.

Check out this thread as well.

Regards,

Gopi

Former Member
0 Kudos

Thanks for your quick reply Gopi.

I don't really want to involve the local dictionary in something like this. My question is even more basic than that. I'm just looking for some example(s) on how to programatically populate a dropdown list on a web dynpro page.

Once I get past the basic stuff I'll be able to delve into the more complex situations where I'm using dictionary or reading values from some database and dynamically building the dropdown.

Also, I didn't really understand your description of the difference between dropdownbyindex and dropdownbykey. Do you have a link you could point me to that would explain/illustrate the differences.

Lastly, the link you provided... when I follow it I get the following message "The specified thread [0] was not found". Could you double-check it please?

Thanks again!

David.

Former Member
0 Kudos

hi,

go through some standard examples.

The below link has many examples.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de1...

Check out Tutorial 8, 16.

regards,

Gopi

Former Member
0 Kudos

Very short explanation:

*ByIndex:

- Displayed entries are attribute values of elements of a context node with cardinality 0:N

- Selected entry / index = lead selection of node

*ByKey:

- Displayed entries are values of a value set (key/value-pairs) of a DDIC type

- Selected entry = key of such a pair

A DDIC type with value set may be created at designtime using the dictionary editor or you may add such a value set at runtime using the DDIC API.

Armin

Former Member
0 Kudos

Thanks Gopi.