cancel
Showing results for 
Search instead for 
Did you mean: 

How to make textview table field as Inputfield dynamically

Former Member
0 Kudos

hi experts,

I am new to the web dynpro and i am facing 1 problem. i have to create 1 table in this table i have to make some fields inputted and some fields textile, and the 1 textile i have to change dynamically to Inputted during runtime of program based on the input of other field.

I am not able to achieve this. Please can someone give me the detail input so that i can solve this problem.

Thanks and Regards,

Vicky

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Vicky,

Go to Layout, there Right click on Table Properties->create Binding. Here you can find the context you have bound the table to, now you can find Cell Editor of Table Column. Choose Input Field from drop down for columns which you need to be edited.

Now drill down table column, here you bind the read_only property of input_field to seperate attribute in context read_only( need to create this attribute in context which table is bound to).

Now if user selects the row and clicks edit/update button, get the row selected through get_lead_selection method and set the read_only attribute for this row to abap_false. This makes the row editable.

With Regards,

Shridhar

Edited by: shridhar narasimhan on Sep 21, 2010 9:10 AM

arjun_thakur
Active Contributor
0 Kudos

Hi Vicky,

Here is more more approach:

Make all the columns as input field. Create a boolean attribute and bind it with the Read only property of the column's input field. Now according to the logic in ur code, just set this attribute accordingly.

Also refer

I hope it helps.

Madhu2004
Active Contributor
0 Kudos

HI,

Create 2 cell variants for that column. In one cell variant put input fields as cell editor and text view as the cell editor for other cell varinat.

BInd the text view and input field to the same attribute.

For cell varinat of text view view give the varinat name as T and for Input filed give the name as I.

I have trribute in the same node which is binded to the able to contain the selected cell variant value.

Bind this attribute to the SELECTEDCELLVARIANT Property of the table column.

At runtime populate this selected cell varinat attribute value with T ot I based on the requitrement.

You can also refer the below forum:

[Cell editor change dynamically|;

Regards,

Madhu

Edited by: madhu reddy on Sep 21, 2010 11:23 AM

Former Member
0 Kudos

Thanks Madhu for your quick reply. Now i can make that column Input and text. but i want that based on that row. now when i am

giving this conditioins whole column is getting change. how to do it only for perticular row.

Thanks and Regards,

Vicky

Former Member
0 Kudos

Hello Vicky,

You may need another atrtribute in your context node that is bound to table for to hold cell variant for each row/record.

Best regards,

Chinnu

Madhu2004
Active Contributor
0 Kudos

>

> Thanks Madhu for your quick reply. Now i can make that column Input and text. but i want that based on that row. now when i am

> giving this conditioins whole column is getting change. how to do it only for perticular row.

>

> Thanks and Regards,

> Vicky

Have an attribute in the context NODE which is binded to the table.bind this attribute to the SELECTEDCELLVARIIANT.Poplate the value as I when you need input filed and T when you need text view.

Regards,

Madhu