cancel
Showing results for 
Search instead for 
Did you mean: 

using table inputfield as dropdown and simple inputfield field

0 Kudos

Hi Experts,

I have a table where i need to display content in two columns.

The first column values are read-only keys,where as the second column value keeps changing based on the key.

the second column values can be a simple input field or a dropdown based on the key.

for example : ' Name " should be given as inputfield , Where as "Gender" should be given as dropdown.

How can i achieve this in a webdynpro table.

Please let me know,if you need more information.

Thanks

Appala

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Ok..finally i was able to solve it.

Here are the steps how i solved .

1) created two cellvariants in the column one containing inputfiled and the other containing dropdownbyindex

2) created a calculated attribute called "variant" and setting it one of the two variants mentioned based on my kep value.

Thanks everyone for your help.

Thanks

Appala

junwu
Active Contributor
0 Kudos

it is so simple , that's why i say is it a question...

0 Kudos

True. It is simple..Thanks for your help.

Answers (4)

Answers (4)

gowthamsaravanan
Explorer
0 Kudos

Hi Appala,

    

     You can achieve this by using Cell Variants in web dynpro table. Please follow the below steps to achieve your requirement.

Before going to this, please check how to use cell variants inside web dynpro table. then follow the steps[i will give you the overview of your requirement]:

1. Insert Cell variant in your particular column. [You can use multiple cell variants for one column also]

2. Set the different variant key for each one of the cell variants. For Ex. One cell variant key is "InputField" and another cell variant key is "Dropdown".

3. Based on your key values, set that cell variant attribute to your cell variant key values.

For Sample code:

/* cell value is the attribute for keying our values ex. "Name", "Gender" etc. */

/* cell variant is the attribute for Cell Variants */

if(wdContext.currentContextElement().getCellValue().equalsIgnoreCase("Name"))

    {

              wdContext.currentContextElement().setCellVarient("InputField");

    }else if(wdContext.currentContextElement().getCellValue().equalsIgnoreCase("Gender")){

              wdContext.currentContextElement().setCellVarient("Dropdown");

    }

You can go with this code and elaborate as per your requirements.

Thanks & Regards,

0 Kudos

Hi Gowtham,

This is exactly what i have done.

Anyways thanks for the reply.

Thanks

Appala

0 Kudos

Hi ,

Thanks for the response.

This solves my problem to certain extent.

But The dropdown values are not fixed in my case.

Based on the key value(first table column), the values in the dropdown needs to be changed.

For example, if the key column value is Gender , i need to display the dropdown with gender values.

If the key value is Region , i need to display the region specific dropdown values.

This means that i need to create the table content dynamically, please let me know,if there is any sample existing.

Thanks

Appala

Former Member
0 Kudos

Hi Appala,

Using a BRM table might help in this case.

You will have one input and one output column. The input column will be filled with your "Keys" and the output column will be filled with the corresponding values. In Web Dynpro you will handle the result from your BRM and you will fill it in your Input Fields and Dropdowns accordingly.

Regards,

Grigor

Former Member
0 Kudos

Hi Grigor ,

Thanks for the hint.

This would become a bit too much for my application.

Is there any alternative approach ?

Thanks

Appala

Former Member
0 Kudos

Hi Appala,

There could be a different approach, but using BRM has many positive aspects and you should give it another thought.

It will not be hard to apply and it will be very easy to change the data that you fill in the future. With just a simple import from an Excel table you can change all the inputs/outputs and I don't know if a different method can give you that. Plus the coding in Web Dypro will probably be less.

junwu
Active Contributor
0 Kudos

is it a question....

just if ....else....

0 Kudos

Sorry i could not get you.

It is a question and i am looking for somebody's help to proceed.

Table Cell Variants may not be of help as I need to have both inputfield and dropdownlist .

The worst part is that the dropdown list values are not same accross the table column.

The values may change based on the key value.

former_member219762
Contributor
0 Kudos

Hi,

   I hope this will solve your problem.

http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynpro+for+ABAP+Cell+Variants

Regards,

Sreenivas.

junwu
Active Contributor
0 Kudos