cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByIndex in a Table

Former Member
0 Kudos

Hi,

I´m new to Web Dynpro for Java Development and I would like to make a Table with a DropDownByIndex in each row.

My functionality must behave like follows:

In my table I have 3 columns:

The first one has the name of an items, the second one the actual value of the item that the user has selected an in the third colum DropDown with the posible values that the user can select.

Below this table there is a button that the user press in order to save the new values selected in each DropDown in R3.

I would like to know which will be the correct node structure of my context.

I would also like to know how to, dinamically, create the DropDowns and asign them the default value.

Thanks & regards,

Alberto.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Alber

What i got is that your table will contain 3 columns each of which will be a dropdown

1.first dropdown will list all the items

2.second will be actual value of the item

3.third will be values from which user can select

since you are using dropdown create 2 simple types in local dictionary viz item, itemvalue (string as built in type for both) which will be types of your item and its value.

in the enumeration tab you provide the possible values to the data types that you created.

now considering that your item has string value you need to create a node structure as

Node

-itemName(item)

-actualvalue(itemvalue)

-uservalue(itemvalue)

i hope this helps you

Deepak

Answers (2)

Answers (2)

Former Member
0 Kudos

We finally did this functionality in BSP because we where not able to dinamically load each DropDownByKey of the table with a diferent set of values and we didn´t have time to find it out how this could be done.

Anyway, thanks a lot for the answers.

Former Member
0 Kudos

That is really sad

With DropDownByKey it is not possible to have different value sets in one column because the value set is defined at the dictionary type of the context attribute (to which the cell editor of that column is bound) and this is the same for all rows in that column.

But with DropDownByIndex (as you wrote in your original question) this is rather easy.

Example:


Artists (node, 0:n)
- name (string)
- Albums (node, 0:n, non-singleton)
-- title (string)

IArtistsElement artist = wdContext.nodeArtists().createAndAddArtistsElement();
artist.setName("Ray Obiedo");
{
  IAlbumsElement album = artist.nodeAlbums().createAndAddAlbumsElement();
  album.setTitle("Iguana");
}
{
  IAlbumsElement album = artist.nodeAlbums().createAndAddAlbumsElement();
  album.setTitle("Sticks and Stones");
}

Table.dataSource = Artists
TableColumn.tableCellEditor = albumSelector (DropDownByIndex)
albumSelector .texts = Artists.Albums.title

That's it.

Armin

Former Member
0 Kudos

Hi Alberto,

Your context should be designed as follows

-Name of the item should be a attribute of type String

-Actual Value of the item should be a attribute of type Sting

-For dropdown you should create a Node not the attribute with cardinallity 0 to N

When you mapping the context to the table you chouse the third coloum as dropdown by index

(since dropdownbyindex is a class you can create an object of that class and set the attributes)

I think in your case the table will take care of dynamic creation of element.So you need not write separate code for it

Regards

Noel